@alfalab/core-components-modal 6.1.11 → 7.0.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 (130) hide show
  1. package/Component.desktop.d.ts +1 -1
  2. package/Component.desktop.js +4 -7
  3. package/Component.js +9 -9
  4. package/Component.mobile.d.ts +1 -1
  5. package/Component.mobile.js +4 -7
  6. package/Component.responsive.d.ts +1 -1
  7. package/Component.responsive.js +5 -8
  8. package/components/content/Component.js +6 -5
  9. package/components/content/desktop.css +12 -13
  10. package/components/content/index.css +8 -4
  11. package/components/content/mobile.css +6 -4
  12. package/components/footer/Component.js +4 -4
  13. package/components/footer/desktop.css +12 -13
  14. package/components/footer/index.css +8 -6
  15. package/components/footer/layout.css +27 -25
  16. package/components/footer/mobile.css +5 -3
  17. package/components/header/Component.d.ts +3 -47
  18. package/components/header/Component.js +15 -29
  19. package/components/header/desktop.css +23 -27
  20. package/components/header/index.css +8 -42
  21. package/components/header/mobile.css +10 -5
  22. package/cssm/Component.desktop.d.ts +1 -1
  23. package/cssm/Component.desktop.js +4 -8
  24. package/cssm/Component.js +6 -6
  25. package/cssm/Component.mobile.d.ts +1 -1
  26. package/cssm/Component.mobile.js +4 -8
  27. package/cssm/Component.responsive.d.ts +1 -1
  28. package/cssm/Component.responsive.js +5 -9
  29. package/cssm/components/content/Component.js +3 -2
  30. package/cssm/components/content/desktop.module.css +10 -11
  31. package/cssm/components/content/index.module.css +6 -2
  32. package/cssm/components/content/mobile.module.css +3 -1
  33. package/cssm/components/footer/desktop.module.css +6 -7
  34. package/cssm/components/footer/index.module.css +4 -2
  35. package/cssm/components/footer/layout.module.css +2 -0
  36. package/cssm/components/footer/mobile.module.css +2 -0
  37. package/cssm/components/header/Component.d.ts +3 -47
  38. package/cssm/components/header/Component.js +12 -27
  39. package/cssm/components/header/desktop.module.css +11 -15
  40. package/cssm/components/header/index.module.css +5 -39
  41. package/cssm/components/header/mobile.module.css +7 -2
  42. package/cssm/desktop.js +3 -7
  43. package/cssm/desktop.module.css +2 -0
  44. package/cssm/index.js +4 -8
  45. package/cssm/mobile.js +3 -7
  46. package/cssm/mobile.module.css +2 -0
  47. package/cssm/responsive.js +3 -7
  48. package/cssm/vars.css +2 -0
  49. package/desktop.css +11 -9
  50. package/desktop.js +3 -6
  51. package/esm/Component.desktop.d.ts +1 -1
  52. package/esm/Component.desktop.js +2 -5
  53. package/esm/Component.js +4 -4
  54. package/esm/Component.mobile.d.ts +1 -1
  55. package/esm/Component.mobile.js +2 -5
  56. package/esm/Component.responsive.d.ts +1 -1
  57. package/esm/Component.responsive.js +2 -5
  58. package/esm/components/content/Component.js +6 -5
  59. package/esm/components/content/desktop.css +12 -13
  60. package/esm/components/content/index.css +8 -4
  61. package/esm/components/content/mobile.css +6 -4
  62. package/esm/components/footer/Component.js +4 -4
  63. package/esm/components/footer/desktop.css +12 -13
  64. package/esm/components/footer/index.css +8 -6
  65. package/esm/components/footer/layout.css +27 -25
  66. package/esm/components/footer/mobile.css +5 -3
  67. package/esm/components/header/Component.d.ts +3 -47
  68. package/esm/components/header/Component.js +15 -29
  69. package/esm/components/header/desktop.css +23 -27
  70. package/esm/components/header/index.css +8 -42
  71. package/esm/components/header/mobile.css +10 -5
  72. package/esm/desktop.css +11 -9
  73. package/esm/desktop.js +3 -6
  74. package/esm/index.js +4 -7
  75. package/esm/mobile.css +4 -2
  76. package/esm/mobile.js +3 -6
  77. package/esm/responsive.js +3 -6
  78. package/esm/transitions.css +8 -8
  79. package/index.js +4 -7
  80. package/mobile.css +4 -2
  81. package/mobile.js +3 -6
  82. package/modern/Component.desktop.d.ts +1 -1
  83. package/modern/Component.desktop.js +1 -4
  84. package/modern/Component.js +3 -3
  85. package/modern/Component.mobile.d.ts +1 -1
  86. package/modern/Component.mobile.js +1 -4
  87. package/modern/Component.responsive.d.ts +1 -1
  88. package/modern/Component.responsive.js +1 -4
  89. package/modern/components/content/Component.js +5 -4
  90. package/modern/components/content/desktop.css +12 -13
  91. package/modern/components/content/index.css +8 -4
  92. package/modern/components/content/mobile.css +6 -4
  93. package/modern/components/footer/Component.js +4 -4
  94. package/modern/components/footer/desktop.css +12 -13
  95. package/modern/components/footer/index.css +8 -6
  96. package/modern/components/footer/layout.css +27 -25
  97. package/modern/components/footer/mobile.css +5 -3
  98. package/modern/components/header/Component.d.ts +3 -47
  99. package/modern/components/header/Component.js +14 -28
  100. package/modern/components/header/desktop.css +23 -27
  101. package/modern/components/header/index.css +8 -42
  102. package/modern/components/header/mobile.css +10 -5
  103. package/modern/desktop.css +11 -9
  104. package/modern/desktop.js +2 -5
  105. package/modern/index.js +3 -6
  106. package/modern/mobile.css +4 -2
  107. package/modern/mobile.js +2 -5
  108. package/modern/responsive.js +2 -5
  109. package/modern/transitions.css +8 -8
  110. package/package.json +8 -6
  111. package/responsive.js +3 -6
  112. package/transitions.css +8 -8
  113. package/components/closer/Component.d.ts +0 -33
  114. package/components/closer/Component.js +0 -35
  115. package/components/closer/index.css +0 -49
  116. package/cssm/components/closer/Component.d.ts +0 -33
  117. package/cssm/components/closer/Component.js +0 -34
  118. package/cssm/components/closer/index.module.css +0 -48
  119. package/cssm/tslib.es6-bbd6cd2a.d.ts +0 -36
  120. package/cssm/tslib.es6-bbd6cd2a.js +0 -42
  121. package/esm/components/closer/Component.d.ts +0 -33
  122. package/esm/components/closer/Component.js +0 -28
  123. package/esm/components/closer/index.css +0 -49
  124. package/esm/tslib.es6-e8bed2ca.d.ts +0 -36
  125. package/esm/tslib.es6-e8bed2ca.js +0 -40
  126. package/modern/components/closer/Component.d.ts +0 -33
  127. package/modern/components/closer/Component.js +0 -25
  128. package/modern/components/closer/index.css +0 -49
  129. package/tslib.es6-190a7f3a.d.ts +0 -36
  130. package/tslib.es6-190a7f3a.js +0 -42
@@ -4,22 +4,23 @@ import { ModalContext } from '../../Context.js';
4
4
  import { ResponsiveContext } from '../../ResponsiveContext.js';
5
5
  import '@alfalab/core-components-base-modal/esm';
6
6
 
7
- var desktopStyles = {"s":"modal__s_h3mi6","m":"modal__m_h3mi6","l":"modal__l_h3mi6","xl":"modal__xl_h3mi6","fullscreen":"modal__fullscreen_h3mi6"};
7
+ var desktopStyles = {"s":"modal__s_10lsq","m":"modal__m_10lsq","l":"modal__l_10lsq","xl":"modal__xl_10lsq","fullscreen":"modal__fullscreen_10lsq"};
8
8
  require('./desktop.css')
9
9
 
10
- var styles = {"content":"modal__content_t6c0i","flex":"modal__flex_t6c0i"};
10
+ var styles = {"content":"modal__content_9o5rw","withHeader":"modal__withHeader_9o5rw","flex":"modal__flex_9o5rw"};
11
11
  require('./index.css')
12
12
 
13
- var mobileStyles = {"content":"modal__content_8dpzl"};
13
+ var mobileStyles = {"content":"modal__content_rvw86"};
14
14
  require('./mobile.css')
15
15
 
16
16
  var Content = function (_a) {
17
17
  var _b;
18
18
  var children = _a.children, flex = _a.flex, className = _a.className;
19
- var contentRef = useContext(ModalContext).contentRef;
20
- var _c = useContext(ResponsiveContext), size = _c.size, view = _c.view;
19
+ var _c = useContext(ModalContext), contentRef = _c.contentRef, hasHeader = _c.hasHeader;
20
+ var _d = useContext(ResponsiveContext), size = _d.size, view = _d.view;
21
21
  return (React.createElement("div", { className: cn(styles.content, className, (_b = {},
22
22
  _b[styles.flex] = flex,
23
+ _b[styles.withHeader] = hasHeader,
23
24
  _b[desktopStyles[size]] = view === 'desktop' && size,
24
25
  _b[mobileStyles.content] = view === 'mobile',
25
26
  _b)), ref: contentRef }, children));
@@ -1,4 +1,4 @@
1
- /* hash: 1e2xc */
1
+ /* hash: 31pcf */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  } :root {
@@ -12,7 +12,7 @@
12
12
  /* Hard up */
13
13
  } :root {
14
14
  } :root {
15
- --gap-6xl: 72px;
15
+ --gap-3xl: 40px;
16
16
  } :root {
17
17
  } :root {
18
18
  } :root {
@@ -20,23 +20,22 @@
20
20
  /* sizes */
21
21
 
22
22
  /* paddings */
23
- --modal-s-content-paddings: 0 56px;
24
- --modal-s-content-only-bottom-padding: 56px;
23
+ --modal-s-content-paddings: var(--gap-3xl) var(--gap-3xl) 0;
24
+ --modal-s-content-only-bottom-padding: var(--gap-3xl);
25
25
 
26
26
  /* scroll */
27
27
 
28
28
  /* desktop */
29
29
 
30
30
  /* mobile */
31
- } .modal__s_h3mi6,
32
- .modal__m_h3mi6 {
31
+
32
+ /* paddings */
33
+ } .modal__s_10lsq,
34
+ .modal__m_10lsq,
35
+ .modal__l_10lsq,
36
+ .modal__xl_10lsq,
37
+ .modal__fullscreen_10lsq {
33
38
  padding: var(--modal-s-content-paddings)
34
- } .modal__s_h3mi6:last-child, .modal__m_h3mi6:last-child {
39
+ } .modal__s_10lsq:last-child, .modal__m_10lsq:last-child, .modal__l_10lsq:last-child, .modal__xl_10lsq:last-child, .modal__fullscreen_10lsq:last-child {
35
40
  padding-bottom: var(--modal-s-content-only-bottom-padding);
36
- } .modal__l_h3mi6,
37
- .modal__xl_h3mi6,
38
- .modal__fullscreen_h3mi6 {
39
- padding: 0 var(--gap-6xl)
40
- } .modal__l_h3mi6:last-child, .modal__xl_h3mi6:last-child, .modal__fullscreen_h3mi6:last-child {
41
- padding-bottom: var(--gap-6xl);
42
41
  }
@@ -1,4 +1,4 @@
1
- /* hash: 1j0yh */
1
+ /* hash: 7zqh4 */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  } :root {
@@ -25,9 +25,13 @@
25
25
  /* desktop */
26
26
 
27
27
  /* mobile */
28
- } .modal__content_t6c0i {
28
+
29
+ /* paddings */
30
+ } .modal__content_9o5rw {
29
31
  box-sizing: border-box;
30
- width: 100%;
31
- } .modal__flex_t6c0i {
32
+ width: 100%
33
+ } .modal__content_9o5rw.modal__withHeader_9o5rw {
34
+ padding-top: 0;
35
+ } .modal__flex_9o5rw {
32
36
  flex: 1;
33
37
  }
@@ -1,4 +1,4 @@
1
- /* hash: dfaex */
1
+ /* hash: q0wl1 */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  } :root {
@@ -26,8 +26,10 @@
26
26
  /* desktop */
27
27
 
28
28
  /* mobile */
29
- } .modal__content_8dpzl {
30
- padding: 0 var(--gap-m)
31
- } .modal__content_8dpzl:last-child {
29
+
30
+ /* paddings */
31
+ } .modal__content_rvw86 {
32
+ padding: var(--gap-m) var(--gap-m) 0
33
+ } .modal__content_rvw86:last-child {
32
34
  padding-bottom: var(--gap-m);
33
35
  }
@@ -4,16 +4,16 @@ import { ModalContext } from '../../Context.js';
4
4
  import { ResponsiveContext } from '../../ResponsiveContext.js';
5
5
  import '@alfalab/core-components-base-modal/esm';
6
6
 
7
- var desktopStyles = {"footer":"modal__footer_14hl9","sticky":"modal__sticky_14hl9","fullscreen":"modal__fullscreen_14hl9","s":"modal__s_14hl9","m":"modal__m_14hl9","l":"modal__l_14hl9","xl":"modal__xl_14hl9"};
7
+ var desktopStyles = {"footer":"modal__footer_kzf10","sticky":"modal__sticky_kzf10","fullscreen":"modal__fullscreen_kzf10","s":"modal__s_kzf10","m":"modal__m_kzf10","l":"modal__l_kzf10","xl":"modal__xl_kzf10"};
8
8
  require('./desktop.css')
9
9
 
10
- var styles = {"footer":"modal__footer_pjxzd","sticky":"modal__sticky_pjxzd","highlighted":"modal__highlighted_pjxzd"};
10
+ var styles = {"footer":"modal__footer_19247","sticky":"modal__sticky_19247","highlighted":"modal__highlighted_19247"};
11
11
  require('./index.css')
12
12
 
13
- var layoutStyles = {"column":"modal__column_1pjnf","gap-16":"modal__gap-16_1pjnf","gap-24":"modal__gap-24_1pjnf","gap-32":"modal__gap-32_1pjnf","start":"modal__start_1pjnf","center":"modal__center_1pjnf","space-between":"modal__space-between_1pjnf"};
13
+ var layoutStyles = {"column":"modal__column_161h6","gap-16":"modal__gap-16_161h6","gap-24":"modal__gap-24_161h6","gap-32":"modal__gap-32_161h6","start":"modal__start_161h6","center":"modal__center_161h6","space-between":"modal__space-between_161h6"};
14
14
  require('./layout.css')
15
15
 
16
- var mobileStyles = {"footer":"modal__footer_1f4jy","sticky":"modal__sticky_1f4jy"};
16
+ var mobileStyles = {"footer":"modal__footer_vmdq8","sticky":"modal__sticky_vmdq8"};
17
17
  require('./mobile.css')
18
18
 
19
19
  var Footer = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: 18gb0 */
1
+ /* hash: 1hqlk */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  } :root {
@@ -14,9 +14,7 @@
14
14
  --border-radius-l: 12px;
15
15
  } :root {
16
16
  --gap-xl: 24px;
17
- --gap-2xl: 32px;
18
17
  --gap-3xl: 40px;
19
- --gap-6xl: 72px;
20
18
  } :root {
21
19
  } :root {
22
20
  } :root {
@@ -26,25 +24,26 @@
26
24
  /* sizes */
27
25
 
28
26
  /* paddings */
29
- --modal-s-footer-paddings: var(--gap-xl) 56px 56px;
27
+ --modal-s-footer-paddings: var(--gap-xl) var(--gap-3xl) var(--gap-3xl);
30
28
 
31
29
  /* scroll */
32
30
 
33
31
  /* desktop */
34
32
 
35
33
  /* mobile */
36
- } .modal__footer_14hl9 {
34
+
35
+ /* paddings */
36
+ } .modal__footer_kzf10 {
37
37
  border-bottom-left-radius: var(--modal-border-radius);
38
38
  border-bottom-right-radius: var(--modal-border-radius);
39
- } .modal__sticky_14hl9 {
39
+ } .modal__sticky_kzf10 {
40
40
  bottom: calc(var(--modal-vertical-padding) * -1)
41
- } .modal__sticky_14hl9.modal__fullscreen_14hl9 {
41
+ } .modal__sticky_kzf10.modal__fullscreen_kzf10 {
42
42
  bottom: 0;
43
- } .modal__s_14hl9,
44
- .modal__m_14hl9 {
43
+ } .modal__s_kzf10,
44
+ .modal__m_kzf10,
45
+ .modal__l_kzf10,
46
+ .modal__xl_kzf10,
47
+ .modal__fullscreen_kzf10 {
45
48
  padding: var(--modal-s-footer-paddings);
46
- } .modal__l_14hl9,
47
- .modal__xl_14hl9,
48
- .modal__fullscreen_14hl9 {
49
- padding: var(--gap-2xl) var(--gap-6xl) var(--gap-6xl);
50
49
  }
@@ -1,8 +1,8 @@
1
- /* hash: 10nc4 */
1
+ /* hash: 19xmn */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-bg-primary: #fff;
5
- --color-light-border-primary: #dbdee1;
5
+ --color-light-border-secondary: #e7e9eb;
6
6
  } :root {
7
7
  } :root {
8
8
  } :root {
@@ -25,19 +25,21 @@
25
25
 
26
26
  /* scroll */
27
27
  --modal-footer-highlight-background: var(--color-light-bg-primary);
28
- --modal-footer-highlight-box-shadow: 0 -1px 0 0 var(--color-light-border-primary);
28
+ --modal-footer-highlight-box-shadow: 0 -1px 0 0 var(--color-light-border-secondary);
29
29
 
30
30
  /* desktop */
31
31
 
32
32
  /* mobile */
33
- } .modal__footer_pjxzd {
33
+
34
+ /* paddings */
35
+ } .modal__footer_19247 {
34
36
  width: 100%;
35
37
  box-sizing: border-box;
36
38
  transition: box-shadow 0.2s ease, background 0.2s ease;
37
- } .modal__sticky_pjxzd {
39
+ } .modal__sticky_19247 {
38
40
  background: var(--modal-footer-background);
39
41
  position: sticky;
40
- } .modal__highlighted_pjxzd {
42
+ } .modal__highlighted_19247 {
41
43
  background: var(--modal-footer-highlight-background);
42
44
  box-shadow: var(--modal-footer-highlight-box-shadow);
43
45
  }
@@ -1,4 +1,4 @@
1
- /* hash: 4yw58 */
1
+ /* hash: e96ok */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  } :root {
@@ -29,45 +29,47 @@
29
29
  /* desktop */
30
30
 
31
31
  /* mobile */
32
- } .modal__column_1pjnf {
32
+
33
+ /* paddings */
34
+ } .modal__column_161h6 {
33
35
  display: flex;
34
36
  flex-direction: column
35
- } .modal__column_1pjnf > * {
37
+ } .modal__column_161h6 > * {
36
38
  margin-bottom: var(--modal-footer-default-gap);
37
- } .modal__column_1pjnf > *:last-child,
38
- .modal__column_1pjnf > *:only-child {
39
+ } .modal__column_161h6 > *:last-child,
40
+ .modal__column_161h6 > *:only-child {
39
41
  margin-bottom: 0;
40
- } .modal__column_1pjnf.modal__gap-16_1pjnf > * {
42
+ } .modal__column_161h6.modal__gap-16_161h6 > * {
41
43
  margin-bottom: var(--gap-m);
42
- } .modal__column_1pjnf.modal__gap-24_1pjnf > * {
44
+ } .modal__column_161h6.modal__gap-24_161h6 > * {
43
45
  margin-bottom: var(--gap-xl);
44
- } .modal__column_1pjnf.modal__gap-32_1pjnf > * {
46
+ } .modal__column_161h6.modal__gap-32_161h6 > * {
45
47
  margin-bottom: var(--gap-2xl);
46
- } .modal__start_1pjnf {
48
+ } .modal__start_161h6 {
47
49
  justify-content: flex-start;
48
- } .modal__center_1pjnf {
50
+ } .modal__center_161h6 {
49
51
  justify-content: center;
50
- } .modal__space-between_1pjnf {
52
+ } .modal__space-between_161h6 {
51
53
  justify-content: space-between
52
- } .modal__space-between_1pjnf > * {
54
+ } .modal__space-between_161h6 > * {
53
55
  flex: 1;
54
- } .modal__start_1pjnf,
55
- .modal__center_1pjnf,
56
- .modal__space-between_1pjnf {
56
+ } .modal__start_161h6,
57
+ .modal__center_161h6,
58
+ .modal__space-between_161h6 {
57
59
  display: flex
58
- } .modal__start_1pjnf > *, .modal__center_1pjnf > *, .modal__space-between_1pjnf > * {
60
+ } .modal__start_161h6 > *, .modal__center_161h6 > *, .modal__space-between_161h6 > * {
59
61
  margin-right: var(--modal-footer-default-gap);
60
- } .modal__start_1pjnf > *:last-child,
61
- .modal__start_1pjnf > *:only-child,
62
- .modal__center_1pjnf > *:last-child,
63
- .modal__center_1pjnf > *:only-child,
64
- .modal__space-between_1pjnf > *:last-child,
65
- .modal__space-between_1pjnf > *:only-child {
62
+ } .modal__start_161h6 > *:last-child,
63
+ .modal__start_161h6 > *:only-child,
64
+ .modal__center_161h6 > *:last-child,
65
+ .modal__center_161h6 > *:only-child,
66
+ .modal__space-between_161h6 > *:last-child,
67
+ .modal__space-between_161h6 > *:only-child {
66
68
  margin-right: 0;
67
- } .modal__start_1pjnf.modal__gap-16_1pjnf > *, .modal__center_1pjnf.modal__gap-16_1pjnf > *, .modal__space-between_1pjnf.modal__gap-16_1pjnf > * {
69
+ } .modal__start_161h6.modal__gap-16_161h6 > *, .modal__center_161h6.modal__gap-16_161h6 > *, .modal__space-between_161h6.modal__gap-16_161h6 > * {
68
70
  margin-right: var(--gap-m);
69
- } .modal__start_1pjnf.modal__gap-24_1pjnf > *, .modal__center_1pjnf.modal__gap-24_1pjnf > *, .modal__space-between_1pjnf.modal__gap-24_1pjnf > * {
71
+ } .modal__start_161h6.modal__gap-24_161h6 > *, .modal__center_161h6.modal__gap-24_161h6 > *, .modal__space-between_161h6.modal__gap-24_161h6 > * {
70
72
  margin-right: var(--gap-xl);
71
- } .modal__start_1pjnf.modal__gap-32_1pjnf > *, .modal__center_1pjnf.modal__gap-32_1pjnf > *, .modal__space-between_1pjnf.modal__gap-32_1pjnf > * {
73
+ } .modal__start_161h6.modal__gap-32_161h6 > *, .modal__center_161h6.modal__gap-32_161h6 > *, .modal__space-between_161h6.modal__gap-32_161h6 > * {
72
74
  margin-right: var(--gap-2xl);
73
75
  }
@@ -1,4 +1,4 @@
1
- /* hash: 1fljd */
1
+ /* hash: 5pqlo */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  } :root {
@@ -26,8 +26,10 @@
26
26
  /* desktop */
27
27
 
28
28
  /* mobile */
29
- } .modal__footer_1f4jy {
29
+
30
+ /* paddings */
31
+ } .modal__footer_vmdq8 {
30
32
  padding: var(--gap-m);
31
- } .modal__sticky_1f4jy {
33
+ } .modal__sticky_vmdq8 {
32
34
  bottom: 0;
33
35
  }
@@ -1,49 +1,5 @@
1
- import { FC, ReactNode } from 'react';
2
- type HeaderProps = {
3
- /**
4
- * Контент шапки
5
- */
6
- children?: ReactNode;
7
- /**
8
- * Слот слева
9
- */
10
- leftAddons?: ReactNode;
11
- /**
12
- * Наличие компонента крестика
13
- */
14
- hasCloser?: ReactNode;
15
- /**
16
- * Дополнительный класс
17
- */
18
- className?: string;
19
- /**
20
- * Дополнительный класс для аддонов
21
- */
22
- addonClassName?: string;
23
- /**
24
- * Дополнительный класс для контента
25
- */
26
- contentClassName?: string;
27
- /**
28
- * Заголовок шапки
29
- */
30
- title?: string;
31
- /**
32
- * Выравнивание заголовка
33
- */
34
- align?: 'left' | 'center';
35
- /**
36
- * Обрезать ли заголовок
37
- */
38
- trim?: boolean;
39
- /**
40
- * Фиксирует шапку
41
- */
42
- sticky?: boolean;
43
- /**
44
- * Идентификатор для систем автоматизированного тестирования
45
- */
46
- dataTestId?: string;
47
- };
1
+ import { FC } from 'react';
2
+ import { NavigationBarProps } from "@alfalab/core-components-navigation-bar";
3
+ type HeaderProps = Omit<NavigationBarProps, 'size' | 'view' | 'parentRef'>;
48
4
  declare const Header: FC<HeaderProps>;
49
5
  export { HeaderProps, Header };
@@ -1,56 +1,42 @@
1
+ import { __rest, __assign } from 'tslib';
1
2
  import React, { useContext, useEffect } from 'react';
2
3
  import cn from 'classnames';
3
- import { CrossMIcon } from '@alfalab/icons-glyph/CrossMIcon';
4
+ import { NavigationBar } from '@alfalab/core-components-navigation-bar/esm';
4
5
  import { ModalContext } from '../../Context.js';
5
6
  import { ResponsiveContext } from '../../ResponsiveContext.js';
6
- import { Closer } from '../closer/Component.js';
7
7
  import '@alfalab/core-components-base-modal/esm';
8
- import '../../tslib.es6-e8bed2ca.js';
9
- import '@alfalab/core-components-icon-button/esm';
10
- import '@alfalab/icons-glyph/CrossHeavyMIcon';
11
8
 
12
- var getDataTestId = function (dataTestId, element) {
13
- var elementPart = element ? "-".concat(element.toLowerCase()) : '';
14
- return dataTestId ? "".concat(dataTestId).concat(elementPart) : undefined;
15
- };
16
-
17
- var desktopStyles = {"header":"modal__header_1ijyn","content":"modal__content_1ijyn","s":"modal__s_1ijyn","m":"modal__m_1ijyn","l":"modal__l_1ijyn","xl":"modal__xl_1ijyn","fullscreen":"modal__fullscreen_1ijyn","hasContent":"modal__hasContent_1ijyn","sticky":"modal__sticky_1ijyn"};
9
+ var desktopStyles = {"header":"modal__header_z1sf9","content":"modal__content_z1sf9","s":"modal__s_z1sf9","m":"modal__m_z1sf9","l":"modal__l_z1sf9","xl":"modal__xl_z1sf9","fullscreen":"modal__fullscreen_z1sf9","sticky":"modal__sticky_z1sf9"};
18
10
  require('./desktop.css')
19
11
 
20
- var styles = {"header":"modal__header_675cx","hasContent":"modal__hasContent_675cx","highlighted":"modal__highlighted_675cx","sticky":"modal__sticky_675cx","content":"modal__content_675cx","title":"modal__title_675cx","addon":"modal__addon_675cx","closer":"modal__closer_675cx","left":"modal__left_675cx","center":"modal__center_675cx","right":"modal__right_675cx","trim":"modal__trim_675cx"};
12
+ var styles = {"highlighted":"modal__highlighted_ppblj","sticky":"modal__sticky_ppblj","hasContent":"modal__hasContent_ppblj"};
21
13
  require('./index.css')
22
14
 
23
- var mobileStyles = {"sticky":"modal__sticky_1hwbh","content":"modal__content_1hwbh"};
15
+ var mobileStyles = {"header":"modal__header_ye58l","sticky":"modal__sticky_ye58l","content":"modal__content_ye58l"};
24
16
  require('./mobile.css')
25
17
 
26
18
  var Header = function (_a) {
27
19
  var _b, _c;
28
- var className = _a.className, addonClassName = _a.addonClassName, contentClassName = _a.contentClassName, leftAddons = _a.leftAddons, children = _a.children, _d = _a.align, align = _d === void 0 ? 'left' : _d, _e = _a.trim, trim = _e === void 0 ? true : _e, title = _a.title, _f = _a.hasCloser, hasCloser = _f === void 0 ? true : _f, sticky = _a.sticky, dataTestId = _a.dataTestId;
29
- var _g = useContext(ModalContext), headerHighlighted = _g.headerHighlighted, setHasHeader = _g.setHasHeader;
30
- var _h = useContext(ResponsiveContext), size = _h.size, view = _h.view;
31
- var hasContent = title || Boolean(children);
20
+ var className = _a.className, sticky = _a.sticky, title = _a.title, children = _a.children, contentClassName = _a.contentClassName, _d = _a.hasCloser, hasCloser = _d === void 0 ? true : _d, restProps = __rest(_a, ["className", "sticky", "title", "children", "contentClassName", "hasCloser"]);
21
+ var _e = useContext(ModalContext), setHasHeader = _e.setHasHeader, headerHighlighted = _e.headerHighlighted, parentRef = _e.parentRef, onClose = _e.onClose;
22
+ var _f = useContext(ResponsiveContext), view = _f.view, size = _f.size;
32
23
  useEffect(function () {
33
24
  setHasHeader(true);
34
25
  }, [setHasHeader]);
35
- return (React.createElement("div", { className: cn(styles.header, className, (_b = {},
26
+ var hasContent = Boolean(title || children);
27
+ return (React.createElement(NavigationBar, __assign({}, restProps, { parentRef: parentRef, hasCloser: hasCloser, sticky: sticky, view: view, title: title, onClose: onClose, className: cn(className, (_b = {},
36
28
  _b[styles.highlighted] = hasContent && sticky && headerHighlighted,
37
29
  _b[styles.sticky] = sticky,
38
30
  _b[styles.hasContent] = hasContent,
39
31
  _b[desktopStyles.header] = view === 'desktop',
40
- _b[desktopStyles.hasContent] = view === 'desktop' && hasContent,
41
32
  _b[desktopStyles.sticky] = view === 'desktop' && sticky,
42
33
  _b[desktopStyles[size]] = view === 'desktop',
34
+ _b[mobileStyles.header] = view === 'mobile',
43
35
  _b[mobileStyles.sticky] = view === 'mobile' && sticky,
44
- _b)), "data-test-id": getDataTestId(dataTestId) },
45
- (leftAddons || view === 'desktop') && (React.createElement("div", { className: cn(styles.addon, addonClassName) }, leftAddons)),
46
- hasContent && (React.createElement("div", { className: cn(styles.content, contentClassName, styles[align], (_c = {},
47
- _c[styles.trim] = trim,
48
- _c[desktopStyles.content] = view === 'desktop',
49
- _c[mobileStyles.content] = view === 'mobile',
50
- _c)) },
51
- children,
52
- title && (React.createElement("div", { className: styles.title, "data-test-id": getDataTestId(dataTestId, 'title') }, title)))),
53
- hasCloser && (React.createElement("div", { className: cn(styles.addon, styles.closer, addonClassName) }, view === 'desktop' ? (React.createElement(Closer, { dataTestId: getDataTestId(dataTestId, 'closer') })) : (React.createElement(Closer, { icon: CrossMIcon, size: 'xs', dataTestId: getDataTestId(dataTestId, 'closer') }))))));
36
+ _b)), contentClassName: cn(contentClassName, (_c = {},
37
+ _c[desktopStyles.content] = view === 'desktop',
38
+ _c[mobileStyles.content] = view === 'mobile',
39
+ _c)) }), children));
54
40
  };
55
41
 
56
42
  export { Header };
@@ -1,4 +1,4 @@
1
- /* hash: 1i3z2 */
1
+ /* hash: 18toj */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  } :root {
@@ -13,9 +13,8 @@
13
13
  } :root {
14
14
  --border-radius-l: 12px;
15
15
  } :root {
16
- --gap-xs: 8px;
16
+ --gap-s: 12px;
17
17
  --gap-m: 16px;
18
- --gap-xl: 24px;
19
18
  --gap-3xl: 40px;
20
19
  } :root {
21
20
  --font-family-system: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica,
@@ -28,51 +27,48 @@
28
27
  /* sizes */
29
28
 
30
29
  /* paddings */
31
- --modal-s-header-paddings: var(--gap-xs) var(--gap-xs) var(--gap-m);
30
+ --modal-s-header-paddings: 28px 28px 0;
32
31
 
33
32
  /* scroll */
34
33
 
35
34
  /* desktop */
36
- --modal-s-header-desktop-content-paddings: var(--gap-3xl) var(--gap-m) 0 0;
37
- --modal-s-header-desktop-font-size: 22px;
35
+ --modal-s-header-desktop-content-paddings: var(--gap-s);
36
+ --modal-s-header-desktop-font-size: 20px;
38
37
  --modal-s-header-desktop-line-height: 26px;
39
- --modal-l-header-desktop-content-paddings: var(--gap-3xl) var(--gap-m) 0 0;
38
+ --modal-l-header-desktop-content-paddings: 6px var(--gap-s) var(--gap-m);
40
39
  --modal-l-header-desktop-font-size: 30px;
41
40
  --modal-l-header-desktop-line-height: 36px;
42
41
  --modal-header-desktop-font-weight: bold;
43
42
  --modal-header-desktop-font-family: var(--font-family-system);
44
43
 
45
44
  /* mobile */
46
- } .modal__header_1ijyn {
45
+
46
+ /* paddings */
47
+ } .modal__header_z1sf9 {
47
48
  border-top-left-radius: var(--modal-border-radius);
48
49
  border-top-right-radius: var(--modal-border-radius);
49
- } .modal__content_1ijyn {
50
+ } .modal__content_z1sf9 {
50
51
  font-weight: var(--modal-header-desktop-font-weight);
51
52
  font-family: var(--modal-header-desktop-font-family);
52
- } .modal__s_1ijyn .modal__content_1ijyn,
53
- .modal__m_1ijyn .modal__content_1ijyn {
53
+ } .modal__s_z1sf9 .modal__content_z1sf9,
54
+ .modal__m_z1sf9 .modal__content_z1sf9 {
54
55
  padding: var(--modal-s-header-desktop-content-paddings);
55
56
  font-size: var(--modal-s-header-desktop-font-size);
56
57
  line-height: var(--modal-s-header-desktop-line-height);
57
- } .modal__l_1ijyn .modal__content_1ijyn,
58
- .modal__xl_1ijyn .modal__content_1ijyn,
59
- .modal__fullscreen_1ijyn .modal__content_1ijyn {
58
+ } .modal__l_z1sf9 .modal__content_z1sf9,
59
+ .modal__xl_z1sf9 .modal__content_z1sf9,
60
+ .modal__fullscreen_z1sf9 .modal__content_z1sf9 {
60
61
  padding: var(--modal-l-header-desktop-content-paddings);
61
62
  font-size: var(--modal-l-header-desktop-font-size);
62
63
  line-height: var(--modal-l-header-desktop-line-height);
63
- } .modal__s_1ijyn,
64
- .modal__m_1ijyn {
65
- padding: var(--modal-s-header-paddings)
66
- } .modal__s_1ijyn:not(.modal__hasContent_1ijyn), .modal__m_1ijyn:not(.modal__hasContent_1ijyn) {
67
- padding-bottom: 0;
68
- } .modal__l_1ijyn,
69
- .modal__xl_1ijyn,
70
- .modal__fullscreen_1ijyn {
71
- padding: var(--gap-xl) var(--gap-xl) var(--gap-m)
72
- } .modal__l_1ijyn:not(.modal__hasContent_1ijyn), .modal__xl_1ijyn:not(.modal__hasContent_1ijyn), .modal__fullscreen_1ijyn:not(.modal__hasContent_1ijyn) {
73
- padding-bottom: var(--gap-m);
74
- } .modal__sticky_1ijyn {
64
+ } .modal__s_z1sf9,
65
+ .modal__m_z1sf9,
66
+ .modal__l_z1sf9,
67
+ .modal__xl_z1sf9,
68
+ .modal__fullscreen_z1sf9 {
69
+ padding: var(--modal-s-header-paddings);
70
+ } .modal__sticky_z1sf9 {
75
71
  top: calc(var(--modal-vertical-padding) * -1)
76
- } .modal__sticky_1ijyn.modal__fullscreen_1ijyn {
72
+ } .modal__sticky_z1sf9.modal__fullscreen_z1sf9 {
77
73
  top: 0;
78
74
  }
@@ -1,7 +1,8 @@
1
- /* hash: 1qxo6 */
1
+ /* hash: 1hndm */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-bg-primary: #fff;
5
+ --color-light-border-secondary: #e7e9eb;
5
6
  } :root {
6
7
  } :root {
7
8
  } :root {
@@ -24,54 +25,19 @@
24
25
 
25
26
  /* scroll */
26
27
  --modal-header-highlight-background: var(--color-light-bg-primary);
27
- --modal-header-highlight-box-shadow: none;
28
+ --modal-header-highlight-box-shadow: 0 1px 0 0 var(--color-light-border-secondary);
28
29
 
29
30
  /* desktop */
30
31
 
31
32
  /* mobile */
32
- } .modal__header_675cx {
33
- width: 100%;
34
- box-sizing: border-box;
35
- display: flex;
36
- align-items: stretch;
37
- justify-content: space-between;
38
- transition: box-shadow 0.2s ease, background 0.2s ease
39
- } .modal__header_675cx:not(.modal__hasContent_675cx) {
40
- pointer-events: none;
41
- } .modal__highlighted_675cx {
33
+
34
+ /* paddings */
35
+ } .modal__highlighted_ppblj {
42
36
  background: var(--modal-header-highlight-background);
43
37
  box-shadow: var(--modal-header-highlight-box-shadow);
44
- } .modal__sticky_675cx {
38
+ } .modal__sticky_ppblj {
45
39
  position: sticky;
46
40
  z-index: 1
47
- } .modal__sticky_675cx.modal__hasContent_675cx {
41
+ } .modal__sticky_ppblj.modal__hasContent_ppblj {
48
42
  background: var(--modal-header-background);
49
- } .modal__content_675cx {
50
- flex-grow: 1;
51
- } .modal__title_675cx {
52
- word-break: break-word;
53
- } .modal__addon_675cx {
54
- min-width: 48px;
55
- height: 48px;
56
- display: flex;
57
- justify-content: center;
58
- align-items: center;
59
- pointer-events: all;
60
- } .modal__closer_675cx {
61
- margin-left: auto;
62
- } .modal__left_675cx {
63
- justify-content: flex-start;
64
- text-align: left;
65
- } .modal__center_675cx {
66
- justify-content: center;
67
- text-align: center;
68
- } .modal__right_675cx {
69
- justify-content: flex-end;
70
- text-align: right;
71
- } .modal__trim_675cx {
72
- overflow: hidden
73
- } .modal__trim_675cx .modal__title_675cx {
74
- overflow: hidden;
75
- white-space: nowrap;
76
- text-overflow: ellipsis;
77
43
  }