@alfalab/core-components-navigation-bar-private 0.1.10 → 0.3.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 (46) hide show
  1. package/Component.js +1 -1
  2. package/components/back-arrow-addon/Component.js +1 -1
  3. package/components/back-arrow-addon/index.css +17 -16
  4. package/components/closer/Component.js +1 -1
  5. package/components/closer/index.css +8 -7
  6. package/cssm/components/back-arrow-addon/index.module.css +5 -4
  7. package/cssm/components/closer/index.module.css +2 -1
  8. package/cssm/index.module.css +2 -1
  9. package/esm/Component.js +1 -1
  10. package/esm/components/back-arrow-addon/Component.js +1 -1
  11. package/esm/components/back-arrow-addon/index.css +17 -16
  12. package/esm/components/closer/Component.js +1 -1
  13. package/esm/components/closer/index.css +8 -7
  14. package/esm/index.css +29 -28
  15. package/index.css +29 -28
  16. package/modern/Component.js +1 -1
  17. package/modern/components/back-arrow-addon/Component.js +1 -1
  18. package/modern/components/back-arrow-addon/index.css +17 -16
  19. package/modern/components/closer/Component.js +1 -1
  20. package/modern/components/closer/index.css +8 -7
  21. package/modern/index.css +29 -28
  22. package/moderncssm/Component.d.ts +5 -0
  23. package/moderncssm/Component.js +159 -0
  24. package/moderncssm/components/back-arrow-addon/Component.d.ts +26 -0
  25. package/moderncssm/components/back-arrow-addon/Component.js +21 -0
  26. package/moderncssm/components/back-arrow-addon/index.d.ts +1 -0
  27. package/moderncssm/components/back-arrow-addon/index.js +1 -0
  28. package/moderncssm/components/back-arrow-addon/index.module.css +62 -0
  29. package/moderncssm/components/closer/Component.d.ts +35 -0
  30. package/moderncssm/components/closer/Component.js +18 -0
  31. package/moderncssm/components/closer/index.d.ts +1 -0
  32. package/moderncssm/components/closer/index.js +1 -0
  33. package/moderncssm/components/closer/index.module.css +33 -0
  34. package/moderncssm/index.d.ts +2 -0
  35. package/moderncssm/index.js +1 -0
  36. package/moderncssm/index.module.css +131 -0
  37. package/moderncssm/shared/index.d.ts +2 -0
  38. package/moderncssm/shared/index.js +2 -0
  39. package/moderncssm/types.d.ts +118 -0
  40. package/moderncssm/types.js +1 -0
  41. package/moderncssm/vars.css +7 -0
  42. package/package.json +7 -7
  43. package/src/components/back-arrow-addon/index.module.css +5 -5
  44. package/src/components/closer/index.module.css +2 -2
  45. package/src/index.module.css +2 -2
  46. package/src/vars.css +1 -1
package/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 1k3jt */
1
+ /* hash: v7jbe */
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);
@@ -20,30 +20,31 @@
20
20
  --gap-s: 12px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
21
21
 
22
22
  /* новые значения, используйте их */
23
+ --gap-0: 0;
23
24
  --gap-4: var(--gap-2xs);
24
25
  --gap-12: var(--gap-s);
25
26
  } :root {
26
27
  } :root {
27
- } .navigation-bar-private__header_1ov37 {
28
+ } .navigation-bar-private__header_u5uoj {
28
29
  width: 100%;
29
30
  box-sizing: border-box;
30
31
  transition: box-shadow 0.2s ease, background 0.2s ease
31
- } .navigation-bar-private__header_1ov37.navigation-bar-private__header_1ov37.navigation-bar-private__backgroundImage_1ov37 {
32
+ } .navigation-bar-private__header_u5uoj.navigation-bar-private__header_u5uoj.navigation-bar-private__backgroundImage_u5uoj {
32
33
  background-repeat: no-repeat;
33
34
  background-position: center;
34
35
  background-size: cover;
35
- } .navigation-bar-private__mainLine_1ov37 {
36
+ } .navigation-bar-private__mainLine_u5uoj {
36
37
  display: flex;
37
38
  align-items: stretch;
38
39
  justify-content: space-between;
39
40
  z-index: 1;
40
41
  background-color: inherit;
41
- } .navigation-bar-private__mainLineSticky_1ov37 {
42
+ } .navigation-bar-private__mainLineSticky_u5uoj {
42
43
  position: sticky;
43
- top: 0;
44
- } .navigation-bar-private__mainLineWithImageBg_1ov37 {
44
+ top: var(--gap-0);
45
+ } .navigation-bar-private__mainLineWithImageBg_u5uoj {
45
46
  background-color: initial;
46
- } .navigation-bar-private__content_1ov37 {
47
+ } .navigation-bar-private__content_u5uoj {
47
48
  color: var(--color-light-text-primary);
48
49
  display: flex;
49
50
  flex-flow: column nowrap;
@@ -52,27 +53,27 @@
52
53
  align-self: baseline;
53
54
  box-sizing: border-box;
54
55
  min-height: 48px
55
- } .navigation-bar-private__content_1ov37.navigation-bar-private__withBothAddons_1ov37,
56
- .navigation-bar-private__content_1ov37.navigation-bar-private__withCompactTitle_1ov37 {
56
+ } .navigation-bar-private__content_u5uoj.navigation-bar-private__withBothAddons_u5uoj,
57
+ .navigation-bar-private__content_u5uoj.navigation-bar-private__withCompactTitle_u5uoj {
57
58
  font-size: 16px;
58
59
  line-height: 20px;
59
60
  font-weight: 500;
60
61
  align-self: center;
61
62
  padding-top: var(--gap-4);
62
63
  padding-bottom: var(--gap-4)
63
- } .navigation-bar-private__content_1ov37.navigation-bar-private__withBothAddons_1ov37 > .navigation-bar-private__children_1ov37,
64
- .navigation-bar-private__content_1ov37.navigation-bar-private__withBothAddons_1ov37 > .navigation-bar-private__title_1ov37,
65
- .navigation-bar-private__content_1ov37.navigation-bar-private__withCompactTitle_1ov37 > .navigation-bar-private__children_1ov37,
66
- .navigation-bar-private__content_1ov37.navigation-bar-private__withCompactTitle_1ov37 > .navigation-bar-private__title_1ov37 {
64
+ } .navigation-bar-private__content_u5uoj.navigation-bar-private__withBothAddons_u5uoj > .navigation-bar-private__children_u5uoj,
65
+ .navigation-bar-private__content_u5uoj.navigation-bar-private__withBothAddons_u5uoj > .navigation-bar-private__title_u5uoj,
66
+ .navigation-bar-private__content_u5uoj.navigation-bar-private__withCompactTitle_u5uoj > .navigation-bar-private__children_u5uoj,
67
+ .navigation-bar-private__content_u5uoj.navigation-bar-private__withCompactTitle_u5uoj > .navigation-bar-private__title_u5uoj {
67
68
  -webkit-line-clamp: 1;
68
69
  word-break: break-all;
69
- } .navigation-bar-private__content_1ov37.navigation-bar-private__contentOnBotDesktop_1ov37.navigation-bar-private__contentOnBotDesktop_1ov37 {
70
+ } .navigation-bar-private__content_u5uoj.navigation-bar-private__contentOnBotDesktop_u5uoj.navigation-bar-private__contentOnBotDesktop_u5uoj {
70
71
  padding-top: var(--gap-12);
71
- } .navigation-bar-private__content_1ov37.navigation-bar-private__contentOnBotMobile_1ov37.navigation-bar-private__contentOnBotMobile_1ov37 {
72
+ } .navigation-bar-private__content_u5uoj.navigation-bar-private__contentOnBotMobile_u5uoj.navigation-bar-private__contentOnBotMobile_u5uoj {
72
73
  padding-top: var(--gap-12);
73
- } .navigation-bar-private__title_1ov37 {
74
+ } .navigation-bar-private__title_u5uoj {
74
75
  word-break: break-word;
75
- } .navigation-bar-private__subtitle_1ov37 {
76
+ } .navigation-bar-private__subtitle_u5uoj {
76
77
  font-size: 14px;
77
78
  line-height: 20px;
78
79
  font-weight: 400;
@@ -83,11 +84,11 @@
83
84
 
84
85
  color: var(--color-light-text-secondary);
85
86
  word-break: break-all;
86
- } .navigation-bar-private__addonsWrapper_1ov37 {
87
+ } .navigation-bar-private__addonsWrapper_u5uoj {
87
88
  display: flex;
88
- } .navigation-bar-private__rightAddons_1ov37 {
89
+ } .navigation-bar-private__rightAddons_u5uoj {
89
90
  margin-left: auto;
90
- } .navigation-bar-private__addon_1ov37 {
91
+ } .navigation-bar-private__addon_u5uoj {
91
92
  min-width: 48px;
92
93
  height: 48px;
93
94
  display: flex;
@@ -95,18 +96,18 @@
95
96
  align-items: center;
96
97
  flex-shrink: 0;
97
98
  pointer-events: all;
98
- } .navigation-bar-private__bottomAddons_1ov37 {
99
+ } .navigation-bar-private__bottomAddons_u5uoj {
99
100
  pointer-events: all;
100
- } .navigation-bar-private__closer_1ov37 {
101
+ } .navigation-bar-private__closer_u5uoj {
101
102
  margin-left: auto;
102
- } .navigation-bar-private__left_1ov37 {
103
+ } .navigation-bar-private__left_u5uoj {
103
104
  text-align: left;
104
- } .navigation-bar-private__center_1ov37 {
105
+ } .navigation-bar-private__center_u5uoj {
105
106
  text-align: center;
106
- } .navigation-bar-private__trim_1ov37 {
107
+ } .navigation-bar-private__trim_u5uoj {
107
108
  overflow: hidden
108
- } .navigation-bar-private__trim_1ov37 .navigation-bar-private__title_1ov37,
109
- .navigation-bar-private__trim_1ov37 .navigation-bar-private__children_1ov37 {
109
+ } .navigation-bar-private__trim_u5uoj .navigation-bar-private__title_u5uoj,
110
+ .navigation-bar-private__trim_u5uoj .navigation-bar-private__children_u5uoj {
110
111
  -webkit-line-clamp: 2;
111
112
  display: -webkit-box;
112
113
  -webkit-box-orient: vertical;
@@ -6,7 +6,7 @@ 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_1ov37","backgroundImage":"navigation-bar-private__backgroundImage_1ov37","mainLine":"navigation-bar-private__mainLine_1ov37","mainLineSticky":"navigation-bar-private__mainLineSticky_1ov37","mainLineWithImageBg":"navigation-bar-private__mainLineWithImageBg_1ov37","content":"navigation-bar-private__content_1ov37","withBothAddons":"navigation-bar-private__withBothAddons_1ov37","withCompactTitle":"navigation-bar-private__withCompactTitle_1ov37","children":"navigation-bar-private__children_1ov37","title":"navigation-bar-private__title_1ov37","contentOnBotDesktop":"navigation-bar-private__contentOnBotDesktop_1ov37","contentOnBotMobile":"navigation-bar-private__contentOnBotMobile_1ov37","subtitle":"navigation-bar-private__subtitle_1ov37","addonsWrapper":"navigation-bar-private__addonsWrapper_1ov37","rightAddons":"navigation-bar-private__rightAddons_1ov37","addon":"navigation-bar-private__addon_1ov37","bottomAddons":"navigation-bar-private__bottomAddons_1ov37","closer":"navigation-bar-private__closer_1ov37","left":"navigation-bar-private__left_1ov37","center":"navigation-bar-private__center_1ov37","trim":"navigation-bar-private__trim_1ov37"};
9
+ const styles = {"header":"navigation-bar-private__header_u5uoj","backgroundImage":"navigation-bar-private__backgroundImage_u5uoj","mainLine":"navigation-bar-private__mainLine_u5uoj","mainLineSticky":"navigation-bar-private__mainLineSticky_u5uoj","mainLineWithImageBg":"navigation-bar-private__mainLineWithImageBg_u5uoj","content":"navigation-bar-private__content_u5uoj","withBothAddons":"navigation-bar-private__withBothAddons_u5uoj","withCompactTitle":"navigation-bar-private__withCompactTitle_u5uoj","children":"navigation-bar-private__children_u5uoj","title":"navigation-bar-private__title_u5uoj","contentOnBotDesktop":"navigation-bar-private__contentOnBotDesktop_u5uoj","contentOnBotMobile":"navigation-bar-private__contentOnBotMobile_u5uoj","subtitle":"navigation-bar-private__subtitle_u5uoj","addonsWrapper":"navigation-bar-private__addonsWrapper_u5uoj","rightAddons":"navigation-bar-private__rightAddons_u5uoj","addon":"navigation-bar-private__addon_u5uoj","bottomAddons":"navigation-bar-private__bottomAddons_u5uoj","closer":"navigation-bar-private__closer_u5uoj","left":"navigation-bar-private__left_u5uoj","center":"navigation-bar-private__center_u5uoj","trim":"navigation-bar-private__trim_u5uoj"};
10
10
  require('./index.css')
11
11
 
12
12
  /* eslint-disable complexity */
@@ -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-private__component_1dcgz","mobileComponent":"navigation-bar-private__mobileComponent_1dcgz","flex":"navigation-bar-private__flex_1dcgz","iconWrapper":"navigation-bar-private__iconWrapper_1dcgz","text":"navigation-bar-private__text_1dcgz","mobileWrapper":"navigation-bar-private__mobileWrapper_1dcgz"};
8
+ const styles = {"component":"navigation-bar-private__component_o2stn","mobileComponent":"navigation-bar-private__mobileComponent_o2stn","flex":"navigation-bar-private__flex_o2stn","iconWrapper":"navigation-bar-private__iconWrapper_o2stn","text":"navigation-bar-private__text_o2stn","mobileWrapper":"navigation-bar-private__mobileWrapper_o2stn"};
9
9
  require('./index.css')
10
10
 
11
11
  const BackArrowAddon = ({ text = 'Назад', onClick, className, textOpacity = 1, view, ...htmlAttributes }) => {
@@ -1,4 +1,4 @@
1
- /* hash: 1vp5x */
1
+ /* hash: 1bcmn */
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);
@@ -26,6 +26,7 @@
26
26
  --gap-s: 12px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
27
27
 
28
28
  /* новые значения, используйте их */
29
+ --gap-0: 0;
29
30
  --gap-8: var(--gap-xs);
30
31
  --gap-12: var(--gap-s);
31
32
  } :root {
@@ -35,48 +36,48 @@
35
36
 
36
37
  /* back-arrow */
37
38
  --navigation-bar-back-arrow-mobile-fill: var(--color-light-neutral-translucent-700);
38
- } .navigation-bar-private__component_1dcgz {
39
+ } .navigation-bar-private__component_o2stn {
39
40
  height: 100%;
40
41
  background: var(--color-light-bg-primary-alpha-40);
41
42
  -webkit-backdrop-filter: blur(10px);
42
43
  backdrop-filter: blur(10px);
43
44
  border-radius: var(--border-radius-pill);
44
45
  min-width: 48px
45
- } .navigation-bar-private__component_1dcgz svg > path {
46
+ } .navigation-bar-private__component_o2stn svg > path {
46
47
  transition: fill 0.2s ease;
47
48
  fill: var(--color-light-neutral-translucent-1300);
48
- } .navigation-bar-private__component_1dcgz:hover svg > path {
49
+ } .navigation-bar-private__component_o2stn:hover svg > path {
49
50
  fill: var(--color-light-neutral-translucent-1300-hover);
50
- } .navigation-bar-private__component_1dcgz:active svg > path {
51
+ } .navigation-bar-private__component_o2stn:active svg > path {
51
52
  fill: var(--color-light-neutral-translucent-1300-press);
52
- } .navigation-bar-private__mobileComponent_1dcgz {
53
+ } .navigation-bar-private__mobileComponent_o2stn {
53
54
  height: 32px;
54
55
  min-width: 32px;
55
- margin: 0 var(--gap-8);
56
+ margin: var(--gap-0) var(--gap-8);
56
57
  -webkit-backdrop-filter: none;
57
58
  backdrop-filter: none;
58
59
  background: none;
59
- } .navigation-bar-private__flex_1dcgz {
60
+ } .navigation-bar-private__flex_o2stn {
60
61
  display: flex;
61
62
  align-items: center;
62
- } .navigation-bar-private__iconWrapper_1dcgz {
63
+ } .navigation-bar-private__iconWrapper_o2stn {
63
64
  display: inline-flex;
64
65
  align-items: center;
65
66
  justify-content: center;
66
67
  height: 48px;
67
- margin: 0 var(--gap-8) 0 var(--gap-12);
68
+ margin: var(--gap-0) var(--gap-8) var(--gap-0) var(--gap-12);
68
69
  border-radius: var(--border-radius-circle)
69
- } .navigation-bar-private__iconWrapper_1dcgz + .navigation-bar-private__text_1dcgz {
70
+ } .navigation-bar-private__iconWrapper_o2stn + .navigation-bar-private__text_o2stn {
70
71
  margin-right: var(--gap-12);
71
- } .navigation-bar-private__mobileWrapper_1dcgz {
72
+ } .navigation-bar-private__mobileWrapper_o2stn {
72
73
  width: 32px;
73
74
  height: 32px;
74
75
  background: var(--color-light-neutral-translucent-100);
75
76
  -webkit-backdrop-filter: blur(10px);
76
77
  backdrop-filter: blur(10px);
77
- margin: 0
78
- } .navigation-bar-private__mobileWrapper_1dcgz + .navigation-bar-private__text_1dcgz {
79
- margin: 0 var(--gap-12) 0 var(--gap-8);
80
- } .navigation-bar-private__mobileWrapper_1dcgz svg > path {
78
+ margin: var(--gap-0)
79
+ } .navigation-bar-private__mobileWrapper_o2stn + .navigation-bar-private__text_o2stn {
80
+ margin: var(--gap-0) var(--gap-12) var(--gap-0) var(--gap-8);
81
+ } .navigation-bar-private__mobileWrapper_o2stn svg > path {
81
82
  fill: var(--navigation-bar-back-arrow-mobile-fill);
82
83
  }
@@ -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_1fz4f","button":"navigation-bar-private__button_1fz4f","mobile":"navigation-bar-private__mobile_1fz4f","sticky":"navigation-bar-private__sticky_1fz4f"};
7
+ const styles = {"closer":"navigation-bar-private__closer_l9vw4","button":"navigation-bar-private__button_l9vw4","mobile":"navigation-bar-private__mobile_l9vw4","sticky":"navigation-bar-private__sticky_l9vw4"};
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: h3q07 */
1
+ /* hash: 140h8 */
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);
@@ -21,6 +21,7 @@
21
21
  } :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 */
22
22
 
23
23
  /* новые значения, используйте их */
24
+ --gap-0: 0;
24
25
  } :root {
25
26
  } :root {
26
27
  } :root {
@@ -28,7 +29,7 @@
28
29
  --navigation-bar-closer-mobile-color: var(--color-light-neutral-translucent-700);
29
30
 
30
31
  /* back-arrow */
31
- } .navigation-bar-private__closer_1fz4f {
32
+ } .navigation-bar-private__closer_l9vw4 {
32
33
  flex-shrink: 0;
33
34
  width: 48px;
34
35
  height: 48px;
@@ -36,17 +37,17 @@
36
37
  display: flex;
37
38
  align-items: center;
38
39
  justify-content: center;
39
- } .navigation-bar-private__button_1fz4f {
40
+ } .navigation-bar-private__button_l9vw4 {
40
41
  background: var(--color-light-bg-primary-alpha-40);
41
42
  -webkit-backdrop-filter: blur(10px);
42
43
  backdrop-filter: blur(10px);
43
44
  color: var(--color-light-neutral-translucent-1300)
44
- } .navigation-bar-private__button_1fz4f.navigation-bar-private__mobile_1fz4f {
45
+ } .navigation-bar-private__button_l9vw4.navigation-bar-private__mobile_l9vw4 {
45
46
  background: var(--color-light-neutral-translucent-100);
46
47
  color: var(--navigation-bar-closer-mobile-color);
47
- } .navigation-bar-private__button_1fz4f.navigation-bar-private__button_1fz4f {
48
+ } .navigation-bar-private__button_l9vw4.navigation-bar-private__button_l9vw4 {
48
49
  border-radius: var(--border-radius-circle);
49
- } .navigation-bar-private__sticky_1fz4f {
50
+ } .navigation-bar-private__sticky_l9vw4 {
50
51
  position: sticky;
51
- top: 0;
52
+ top: var(--gap-0);
52
53
  }
package/modern/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: 1k3jt */
1
+ /* hash: v7jbe */
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);
@@ -20,30 +20,31 @@
20
20
  --gap-s: 12px; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
21
21
 
22
22
  /* новые значения, используйте их */
23
+ --gap-0: 0;
23
24
  --gap-4: var(--gap-2xs);
24
25
  --gap-12: var(--gap-s);
25
26
  } :root {
26
27
  } :root {
27
- } .navigation-bar-private__header_1ov37 {
28
+ } .navigation-bar-private__header_u5uoj {
28
29
  width: 100%;
29
30
  box-sizing: border-box;
30
31
  transition: box-shadow 0.2s ease, background 0.2s ease
31
- } .navigation-bar-private__header_1ov37.navigation-bar-private__header_1ov37.navigation-bar-private__backgroundImage_1ov37 {
32
+ } .navigation-bar-private__header_u5uoj.navigation-bar-private__header_u5uoj.navigation-bar-private__backgroundImage_u5uoj {
32
33
  background-repeat: no-repeat;
33
34
  background-position: center;
34
35
  background-size: cover;
35
- } .navigation-bar-private__mainLine_1ov37 {
36
+ } .navigation-bar-private__mainLine_u5uoj {
36
37
  display: flex;
37
38
  align-items: stretch;
38
39
  justify-content: space-between;
39
40
  z-index: 1;
40
41
  background-color: inherit;
41
- } .navigation-bar-private__mainLineSticky_1ov37 {
42
+ } .navigation-bar-private__mainLineSticky_u5uoj {
42
43
  position: sticky;
43
- top: 0;
44
- } .navigation-bar-private__mainLineWithImageBg_1ov37 {
44
+ top: var(--gap-0);
45
+ } .navigation-bar-private__mainLineWithImageBg_u5uoj {
45
46
  background-color: initial;
46
- } .navigation-bar-private__content_1ov37 {
47
+ } .navigation-bar-private__content_u5uoj {
47
48
  color: var(--color-light-text-primary);
48
49
  display: flex;
49
50
  flex-flow: column nowrap;
@@ -52,27 +53,27 @@
52
53
  align-self: baseline;
53
54
  box-sizing: border-box;
54
55
  min-height: 48px
55
- } .navigation-bar-private__content_1ov37.navigation-bar-private__withBothAddons_1ov37,
56
- .navigation-bar-private__content_1ov37.navigation-bar-private__withCompactTitle_1ov37 {
56
+ } .navigation-bar-private__content_u5uoj.navigation-bar-private__withBothAddons_u5uoj,
57
+ .navigation-bar-private__content_u5uoj.navigation-bar-private__withCompactTitle_u5uoj {
57
58
  font-size: 16px;
58
59
  line-height: 20px;
59
60
  font-weight: 500;
60
61
  align-self: center;
61
62
  padding-top: var(--gap-4);
62
63
  padding-bottom: var(--gap-4)
63
- } .navigation-bar-private__content_1ov37.navigation-bar-private__withBothAddons_1ov37 > .navigation-bar-private__children_1ov37,
64
- .navigation-bar-private__content_1ov37.navigation-bar-private__withBothAddons_1ov37 > .navigation-bar-private__title_1ov37,
65
- .navigation-bar-private__content_1ov37.navigation-bar-private__withCompactTitle_1ov37 > .navigation-bar-private__children_1ov37,
66
- .navigation-bar-private__content_1ov37.navigation-bar-private__withCompactTitle_1ov37 > .navigation-bar-private__title_1ov37 {
64
+ } .navigation-bar-private__content_u5uoj.navigation-bar-private__withBothAddons_u5uoj > .navigation-bar-private__children_u5uoj,
65
+ .navigation-bar-private__content_u5uoj.navigation-bar-private__withBothAddons_u5uoj > .navigation-bar-private__title_u5uoj,
66
+ .navigation-bar-private__content_u5uoj.navigation-bar-private__withCompactTitle_u5uoj > .navigation-bar-private__children_u5uoj,
67
+ .navigation-bar-private__content_u5uoj.navigation-bar-private__withCompactTitle_u5uoj > .navigation-bar-private__title_u5uoj {
67
68
  -webkit-line-clamp: 1;
68
69
  word-break: break-all;
69
- } .navigation-bar-private__content_1ov37.navigation-bar-private__contentOnBotDesktop_1ov37.navigation-bar-private__contentOnBotDesktop_1ov37 {
70
+ } .navigation-bar-private__content_u5uoj.navigation-bar-private__contentOnBotDesktop_u5uoj.navigation-bar-private__contentOnBotDesktop_u5uoj {
70
71
  padding-top: var(--gap-12);
71
- } .navigation-bar-private__content_1ov37.navigation-bar-private__contentOnBotMobile_1ov37.navigation-bar-private__contentOnBotMobile_1ov37 {
72
+ } .navigation-bar-private__content_u5uoj.navigation-bar-private__contentOnBotMobile_u5uoj.navigation-bar-private__contentOnBotMobile_u5uoj {
72
73
  padding-top: var(--gap-12);
73
- } .navigation-bar-private__title_1ov37 {
74
+ } .navigation-bar-private__title_u5uoj {
74
75
  word-break: break-word;
75
- } .navigation-bar-private__subtitle_1ov37 {
76
+ } .navigation-bar-private__subtitle_u5uoj {
76
77
  font-size: 14px;
77
78
  line-height: 20px;
78
79
  font-weight: 400;
@@ -83,11 +84,11 @@
83
84
 
84
85
  color: var(--color-light-text-secondary);
85
86
  word-break: break-all;
86
- } .navigation-bar-private__addonsWrapper_1ov37 {
87
+ } .navigation-bar-private__addonsWrapper_u5uoj {
87
88
  display: flex;
88
- } .navigation-bar-private__rightAddons_1ov37 {
89
+ } .navigation-bar-private__rightAddons_u5uoj {
89
90
  margin-left: auto;
90
- } .navigation-bar-private__addon_1ov37 {
91
+ } .navigation-bar-private__addon_u5uoj {
91
92
  min-width: 48px;
92
93
  height: 48px;
93
94
  display: flex;
@@ -95,18 +96,18 @@
95
96
  align-items: center;
96
97
  flex-shrink: 0;
97
98
  pointer-events: all;
98
- } .navigation-bar-private__bottomAddons_1ov37 {
99
+ } .navigation-bar-private__bottomAddons_u5uoj {
99
100
  pointer-events: all;
100
- } .navigation-bar-private__closer_1ov37 {
101
+ } .navigation-bar-private__closer_u5uoj {
101
102
  margin-left: auto;
102
- } .navigation-bar-private__left_1ov37 {
103
+ } .navigation-bar-private__left_u5uoj {
103
104
  text-align: left;
104
- } .navigation-bar-private__center_1ov37 {
105
+ } .navigation-bar-private__center_u5uoj {
105
106
  text-align: center;
106
- } .navigation-bar-private__trim_1ov37 {
107
+ } .navigation-bar-private__trim_u5uoj {
107
108
  overflow: hidden
108
- } .navigation-bar-private__trim_1ov37 .navigation-bar-private__title_1ov37,
109
- .navigation-bar-private__trim_1ov37 .navigation-bar-private__children_1ov37 {
109
+ } .navigation-bar-private__trim_u5uoj .navigation-bar-private__title_u5uoj,
110
+ .navigation-bar-private__trim_u5uoj .navigation-bar-private__children_u5uoj {
110
111
  -webkit-line-clamp: 2;
111
112
  display: -webkit-box;
112
113
  -webkit-box-orient: vertical;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ import { NavigationBarPrivateProps } from "./types";
4
+ declare const NavigationBarPrivate: React.ForwardRefExoticComponent<NavigationBarPrivateProps & React.RefAttributes<HTMLDivElement>>;
5
+ export { NavigationBarPrivate };
@@ -0,0 +1,159 @@
1
+ import React, { forwardRef, useState, useRef, useEffect } from 'react';
2
+ import mergeRefs from 'react-merge-refs';
3
+ import cn from 'classnames';
4
+ import { getDataTestId } from '@alfalab/core-components-shared/moderncssm';
5
+ import { useLayoutEffect_SAFE_FOR_SSR } from '@alfalab/hooks';
6
+ import { BackArrowAddon } from './components/back-arrow-addon/Component.js';
7
+ import { Closer } from './components/closer/Component.js';
8
+ import styles from './index.module.css';
9
+
10
+ /* eslint-disable complexity */
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) => {
13
+ const [scrollTop, setScrollTop] = useState(0);
14
+ const [titleMargin, setTitleMargin] = useState({ left: 0, right: 0 });
15
+ const bottomContentRef = useRef(null);
16
+ const headerRef = useRef(null);
17
+ const mainLinePaddingTopRef = useRef('0px');
18
+ const leftAddonsRef = useRef(null);
19
+ const rightAddonsRef = useRef(null);
20
+ const compactTitle = view === 'mobile' && titleSize === 'compact';
21
+ const hasLeftPart = Boolean(leftAddons || hasBackButton);
22
+ const hasRightPart = Boolean(rightAddons || hasCloser);
23
+ const hasContent = Boolean(title || children);
24
+ const withAnimation = Boolean(view === 'mobile' && hasLeftPart && sticky && !compactTitle);
25
+ const showContentOnTop = hasContent && (compactTitle || !hasLeftPart);
26
+ const showContentOnBot = hasContent && !compactTitle && hasLeftPart;
27
+ const showStaticContentOnTop = !withAnimation && showContentOnTop;
28
+ const showStaticContentOnBot = !withAnimation && showContentOnBot;
29
+ const showAnimatedContentOnTop = withAnimation && showContentOnBot && scrollTop > ADDONS_HEIGHT;
30
+ const showAnimatedContentOnBot = withAnimation && showContentOnBot;
31
+ const headerPaddingTop = mainLinePaddingTopRef.current;
32
+ useLayoutEffect_SAFE_FOR_SSR(() => {
33
+ if (align === 'center' && (showStaticContentOnTop || showAnimatedContentOnTop)) {
34
+ const leftAddonsWidth = leftAddonsRef.current?.offsetWidth || 0;
35
+ const rightAddonsWidth = rightAddonsRef.current?.offsetWidth || 0;
36
+ const marginSize = Math.abs(rightAddonsWidth - leftAddonsWidth);
37
+ const shouldAddLeftMargin = rightAddonsWidth - leftAddonsWidth > 0;
38
+ setTitleMargin((prev) => {
39
+ const newState = shouldAddLeftMargin
40
+ ? { left: marginSize, right: 0 }
41
+ : { left: 0, right: marginSize };
42
+ const isStateChanged = prev.left !== newState.left || prev.right !== newState.right;
43
+ return isStateChanged ? newState : prev;
44
+ });
45
+ }
46
+ }, [
47
+ align,
48
+ showStaticContentOnTop,
49
+ showAnimatedContentOnTop,
50
+ leftAddons,
51
+ rightAddons,
52
+ hasBackButton,
53
+ hasCloser,
54
+ ]);
55
+ useEffect(() => {
56
+ const parent = scrollableParentRef?.current;
57
+ const handleScroll = (ev) => {
58
+ const divElement = ev.target;
59
+ setScrollTop(divElement.scrollTop);
60
+ };
61
+ if (withAnimation && headerRef.current) {
62
+ mainLinePaddingTopRef.current = getComputedStyle(headerRef.current).paddingTop;
63
+ }
64
+ if (withAnimation && parent) {
65
+ parent.addEventListener('scroll', handleScroll);
66
+ }
67
+ return () => parent?.removeEventListener('scroll', handleScroll);
68
+ }, [scrollableParentRef, withAnimation]);
69
+ const renderBackButton = () => {
70
+ let textOpacity = 1;
71
+ if (withAnimation) {
72
+ const height = hasContent ? ADDONS_HEIGHT : ADDONS_HEIGHT / 2;
73
+ textOpacity = Math.max(0, 1 - scrollTop / height);
74
+ }
75
+ else if (compactTitle) {
76
+ textOpacity = 0;
77
+ }
78
+ return (React.createElement("div", { className: cn(styles.addon, backButtonClassName) },
79
+ React.createElement(BackArrowAddon, { "data-test-id": getDataTestId(dataTestId, 'back-button'), ...backButtonProps, textOpacity: textOpacity, view: view, onClick: onBack })));
80
+ };
81
+ const renderContent = (args = {}) => {
82
+ const { extraClassName, wrapperRef, style, hidden } = args;
83
+ return (React.createElement("div", { style: { ...style, visibility: hidden ? 'hidden' : 'visible' }, ref: wrapperRef, className: cn(styles.content, extraClassName, contentClassName, styles[align], {
84
+ [styles.trim]: trim,
85
+ [styles.withCompactTitle]: view === 'mobile' && compactTitle && hasContent,
86
+ }), "aria-hidden": hidden },
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)));
90
+ };
91
+ const renderCloser = () => (React.createElement("div", { className: cn(styles.addon, styles.closer, closerClassName) },
92
+ React.createElement(Closer, { view: view, icon: closerIcon, dataTestId: getDataTestId(dataTestId, 'closer'), onClose: onClose })));
93
+ return (React.createElement("div", { ref: mergeRefs([ref, headerRef]), className: cn(styles.header, className, { [styles.backgroundImage]: imageUrl }), "data-test-id": getDataTestId(dataTestId), style: {
94
+ ...(imageUrl && { backgroundImage: `url(${imageUrl})` }),
95
+ ...(withAnimation &&
96
+ bottomContentRef.current && {
97
+ top: -bottomContentRef.current.scrollHeight,
98
+ }),
99
+ } },
100
+ React.createElement("div", { className: cn(styles.mainLine, {
101
+ [styles.mainLineSticky]: withAnimation,
102
+ [styles.mainLineWithImageBg]: imageUrl,
103
+ }), style: {
104
+ ...(withAnimation
105
+ ? {
106
+ marginTop: `-${headerPaddingTop}`,
107
+ paddingTop: headerPaddingTop,
108
+ }
109
+ : null),
110
+ } },
111
+ hasLeftPart && (React.createElement("div", { className: styles.addonsWrapper, ref: leftAddonsRef },
112
+ hasBackButton && renderBackButton(),
113
+ leftAddons && (React.createElement("div", { className: cn(styles.addon, addonClassName) }, leftAddons)))),
114
+ showStaticContentOnTop &&
115
+ renderContent({
116
+ ...(align === 'center'
117
+ ? {
118
+ style: {
119
+ marginLeft: titleMargin.left,
120
+ marginRight: titleMargin.right,
121
+ },
122
+ }
123
+ : null),
124
+ }),
125
+ showAnimatedContentOnTop &&
126
+ renderContent({
127
+ extraClassName: styles.withBothAddons,
128
+ style: {
129
+ opacity: Math.min(1, (scrollTop - ADDONS_HEIGHT) / ADDONS_HEIGHT),
130
+ ...(align === 'center'
131
+ ? {
132
+ marginLeft: titleMargin.left,
133
+ marginRight: titleMargin.right,
134
+ }
135
+ : null),
136
+ },
137
+ }),
138
+ hasRightPart && (React.createElement("div", { className: cn(styles.addonsWrapper, styles.rightAddons), ref: rightAddonsRef },
139
+ rightAddons && (React.createElement("div", { className: cn(styles.addon, addonClassName) }, rightAddons)),
140
+ hasCloser && renderCloser()))),
141
+ showAnimatedContentOnBot &&
142
+ renderContent({
143
+ wrapperRef: bottomContentRef,
144
+ extraClassName: styles.underAddons,
145
+ style: { opacity: Math.max(0, 1 - scrollTop / ADDONS_HEIGHT) },
146
+ hidden: scrollTop / ADDONS_HEIGHT > 1,
147
+ }),
148
+ showStaticContentOnBot &&
149
+ renderContent({
150
+ extraClassName: cn({
151
+ [styles.contentOnBotDesktop]: view === 'desktop',
152
+ [styles.contentOnBotMobile]: view === 'mobile',
153
+ }),
154
+ }),
155
+ bottomAddons && (React.createElement("div", { className: cn(styles.bottomAddons, bottomAddonsClassName) }, bottomAddons))));
156
+ });
157
+ NavigationBarPrivate.displayName = 'NavigationBarPrivate';
158
+
159
+ export { NavigationBarPrivate };
@@ -0,0 +1,26 @@
1
+ /// <reference types="react" />
2
+ import React from 'react';
3
+ interface BackArrowAddonProps extends React.HTMLAttributes<HTMLButtonElement> {
4
+ /**
5
+ * Текст после иконки
6
+ */
7
+ text?: string | null;
8
+ /**
9
+ * Дополнительный класс
10
+ */
11
+ className?: string;
12
+ /**
13
+ * Вид компонента
14
+ */
15
+ view: 'mobile' | 'desktop';
16
+ /**
17
+ * Прозрачность текста
18
+ */
19
+ textOpacity?: number;
20
+ /**
21
+ * Обработчик клика
22
+ */
23
+ onClick?: () => void;
24
+ }
25
+ declare const BackArrowAddon: React.FC<BackArrowAddonProps>;
26
+ export { BackArrowAddonProps, BackArrowAddon };
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import cn from 'classnames';
3
+ import { ButtonDesktop } from '@alfalab/core-components-button/moderncssm/desktop';
4
+ import { Typography } from '@alfalab/core-components-typography/moderncssm';
5
+ import { ArrowLeftMediumMIcon } from '@alfalab/icons-glyph/ArrowLeftMediumMIcon';
6
+ import { ArrowLeftMIcon } from '@alfalab/icons-glyph/ArrowLeftMIcon';
7
+ import styles from './index.module.css';
8
+
9
+ const BackArrowAddon = ({ text = 'Назад', onClick, className, textOpacity = 1, view, ...htmlAttributes }) => {
10
+ const Icon = view === 'desktop' ? ArrowLeftMediumMIcon : ArrowLeftMIcon;
11
+ const isMobileView = view === 'mobile';
12
+ return (React.createElement(ButtonDesktop, { view: 'text', size: isMobileView ? 'xxs' : 's', onClick: onClick, "aria-label": '\u043D\u0430\u0437\u0430\u0434', className: cn(styles.component, { [styles.mobileComponent]: isMobileView }, className), ...htmlAttributes },
13
+ React.createElement("div", { className: styles.flex },
14
+ React.createElement("div", { className: cn(styles.iconWrapper, {
15
+ [styles.mobileWrapper]: isMobileView,
16
+ }) },
17
+ React.createElement(Icon, null)),
18
+ textOpacity > 0 && text && (React.createElement(Typography.Text, { className: styles.text, view: view === 'desktop' ? 'primary-large' : 'component', weight: 'medium', style: { opacity: textOpacity } }, text)))));
19
+ };
20
+
21
+ export { BackArrowAddon };