@alfalab/core-components-bottom-sheet 4.7.0 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{esm/component-1a553fe5.d.ts → component-781ae88d.d.ts} +7 -1
- package/{component-a50a831b.js → component-781ae88d.js} +33 -42
- package/component.js +2 -2
- package/components/backer/Component.d.ts +4 -0
- package/components/backer/Component.js +4 -4
- package/components/backer/index.css +3 -3
- package/components/closer/Component.d.ts +4 -0
- package/components/closer/Component.js +4 -4
- package/components/closer/index.css +3 -3
- package/components/footer/Component.js +1 -1
- package/components/footer/index.css +4 -4
- package/components/header/Component.js +2 -2
- package/components/header/index.css +17 -17
- package/components/swipeable-backdrop/Component.js +1 -1
- package/{component-a50a831b.d.ts → cssm/component-486b5783.d.ts} +7 -1
- package/cssm/{component-78755a1d.js → component-486b5783.js} +30 -39
- package/cssm/component.js +1 -1
- package/cssm/components/backer/Component.d.ts +4 -0
- package/cssm/components/backer/Component.js +2 -2
- package/cssm/components/closer/Component.d.ts +4 -0
- package/cssm/components/closer/Component.js +2 -2
- package/cssm/components/header/Component.js +1 -1
- package/cssm/index.d.ts +1 -1
- package/cssm/index.js +1 -1
- package/cssm/index.module.css +0 -3
- package/{modern/component-cc142f56.d.ts → esm/component-4ca72d9c.d.ts} +7 -1
- package/esm/{component-1a553fe5.js → component-4ca72d9c.js} +33 -42
- package/esm/component.js +2 -2
- package/esm/components/backer/Component.d.ts +4 -0
- package/esm/components/backer/Component.js +4 -4
- package/esm/components/backer/index.css +3 -3
- package/esm/components/closer/Component.d.ts +4 -0
- package/esm/components/closer/Component.js +4 -4
- package/esm/components/closer/index.css +3 -3
- package/esm/components/footer/Component.js +1 -1
- package/esm/components/footer/index.css +4 -4
- package/esm/components/header/Component.js +2 -2
- package/esm/components/header/index.css +17 -17
- package/esm/components/swipeable-backdrop/Component.js +1 -1
- package/esm/index.css +15 -18
- package/esm/index.d.ts +1 -1
- package/esm/index.js +2 -2
- package/esm/{tslib.es6-f0ff4ec2.d.ts → tslib.es6-4793cff0.d.ts} +0 -0
- package/esm/{tslib.es6-f0ff4ec2.js → tslib.es6-4793cff0.js} +0 -0
- package/index.css +15 -18
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/{cssm/component-78755a1d.d.ts → modern/component-d444787d.d.ts} +7 -1
- package/modern/{component-cc142f56.js → component-d444787d.js} +32 -41
- package/modern/component.js +1 -1
- package/modern/components/backer/Component.d.ts +4 -0
- package/modern/components/backer/Component.js +3 -3
- package/modern/components/backer/index.css +3 -3
- package/modern/components/closer/Component.d.ts +4 -0
- package/modern/components/closer/Component.js +3 -3
- package/modern/components/closer/index.css +3 -3
- package/modern/components/footer/Component.js +1 -1
- package/modern/components/footer/index.css +4 -4
- package/modern/components/header/Component.js +1 -1
- package/modern/components/header/index.css +17 -17
- package/modern/index.css +15 -18
- package/modern/index.d.ts +1 -1
- package/modern/index.js +1 -1
- package/package.json +2 -2
- package/{tslib.es6-7fdb05e4.d.ts → tslib.es6-86a36c7d.d.ts} +0 -0
- package/{tslib.es6-7fdb05e4.js → tslib.es6-86a36c7d.js} +0 -0
- package/CHANGELOG.md +0 -335
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1nuye */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
--color-light-border-primary: #dbdee1;
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
--bottom-sheet-footer-border-top: 1px solid var(--color-light-border-primary);
|
|
19
19
|
--bottom-sheet-footer-background-color: var(--color-light-bg-primary);
|
|
20
20
|
}
|
|
21
|
-
.bottom-
|
|
21
|
+
.bottom-sheet__footer_x0z3h {
|
|
22
22
|
padding: var(--gap-m) var(--gap-m);
|
|
23
23
|
background-color: var(--color-light-bg-primary);
|
|
24
24
|
}
|
|
25
|
-
.bottom-
|
|
25
|
+
.bottom-sheet__sticky_x0z3h {
|
|
26
26
|
position: sticky;
|
|
27
27
|
bottom: 0;
|
|
28
28
|
}
|
|
29
|
-
.bottom-
|
|
29
|
+
.bottom-sheet__highlighted_x0z3h {
|
|
30
30
|
border-top: var(--bottom-sheet-footer-border-top);
|
|
31
31
|
background-color: var(--bottom-sheet-footer-background-color);
|
|
32
32
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '../../tslib.es6-
|
|
1
|
+
import '../../tslib.es6-4793cff0.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import 'react-div-100vh';
|
|
@@ -10,7 +10,7 @@ import '@alfalab/icons-glyph/CrossMIcon';
|
|
|
10
10
|
import '../closer/Component.js';
|
|
11
11
|
import '@alfalab/icons-glyph/ArrowBackMIcon';
|
|
12
12
|
import '../backer/Component.js';
|
|
13
|
-
export { a as Header } from '../../component-
|
|
13
|
+
export { a as Header } from '../../component-4ca72d9c.js';
|
|
14
14
|
import '../footer/Component.js';
|
|
15
15
|
import '@alfalab/core-components-backdrop/esm';
|
|
16
16
|
import '../swipeable-backdrop/Component.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: pfp38 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
--bottom-sheet-title-font-family: var(--font-family-system);
|
|
31
31
|
--bottom-sheet-title-margin-vertical: var(--gap-2xs);
|
|
32
32
|
}
|
|
33
|
-
.bottom-
|
|
33
|
+
.bottom-sheet__headerWrapper_grajk {
|
|
34
34
|
padding: var(--gap-xs);
|
|
35
35
|
padding-bottom: 0;
|
|
36
36
|
background-color: var(--color-light-bg-primary);
|
|
@@ -38,38 +38,38 @@
|
|
|
38
38
|
border-top-left-radius: var(--border-radius-xl);
|
|
39
39
|
z-index: 1;
|
|
40
40
|
}
|
|
41
|
-
.bottom-
|
|
41
|
+
.bottom-sheet__header_grajk {
|
|
42
42
|
display: flex;
|
|
43
43
|
}
|
|
44
|
-
.bottom-
|
|
44
|
+
.bottom-sheet__sticky_grajk {
|
|
45
45
|
position: sticky;
|
|
46
46
|
top: 0;
|
|
47
47
|
}
|
|
48
|
-
.bottom-
|
|
48
|
+
.bottom-sheet__highlighted_grajk {
|
|
49
49
|
border-bottom: var(--bottom-sheet-header-border-bottom);
|
|
50
50
|
}
|
|
51
|
-
.bottom-
|
|
51
|
+
.bottom-sheet__justifyEnd_grajk {
|
|
52
52
|
justify-content: flex-end;
|
|
53
53
|
}
|
|
54
|
-
.bottom-
|
|
54
|
+
.bottom-sheet__addon_grajk {
|
|
55
55
|
display: flex;
|
|
56
56
|
justify-content: center;
|
|
57
57
|
align-items: center;
|
|
58
58
|
min-width: 48px;
|
|
59
59
|
height: 48px;
|
|
60
60
|
}
|
|
61
|
-
.bottom-
|
|
61
|
+
.bottom-sheet__addonFixed_grajk {
|
|
62
62
|
position: fixed;
|
|
63
63
|
}
|
|
64
|
-
.bottom-
|
|
64
|
+
.bottom-sheet__addonLeft_grajk {
|
|
65
65
|
left: 0;
|
|
66
66
|
margin-left: var(--gap-xs);
|
|
67
67
|
}
|
|
68
|
-
.bottom-
|
|
68
|
+
.bottom-sheet__addonRight_grajk {
|
|
69
69
|
right: 0;
|
|
70
70
|
margin-right: var(--gap-xs);
|
|
71
71
|
}
|
|
72
|
-
.bottom-
|
|
72
|
+
.bottom-sheet__title_grajk {
|
|
73
73
|
padding: var(--gap-xs) var(--gap-xs);
|
|
74
74
|
margin: var(--bottom-sheet-title-margin-vertical) 0;
|
|
75
75
|
width: 100%;
|
|
@@ -78,23 +78,23 @@
|
|
|
78
78
|
line-height: var(--bottom-sheet-title-line-height);
|
|
79
79
|
font-family: var(--bottom-sheet-title-font-family);
|
|
80
80
|
}
|
|
81
|
-
.bottom-
|
|
81
|
+
.bottom-sheet__titleCenter_grajk {
|
|
82
82
|
text-align: center;
|
|
83
83
|
}
|
|
84
|
-
.bottom-
|
|
84
|
+
.bottom-sheet__titleLeft_grajk {
|
|
85
85
|
text-align: left;
|
|
86
86
|
}
|
|
87
|
-
.bottom-
|
|
87
|
+
.bottom-sheet__trimTitle_grajk {
|
|
88
88
|
white-space: nowrap;
|
|
89
89
|
overflow: hidden;
|
|
90
90
|
text-overflow: ellipsis;
|
|
91
91
|
}
|
|
92
|
-
.bottom-
|
|
92
|
+
.bottom-sheet__titleBigIndentHorizontal_grajk {
|
|
93
93
|
margin: var(--bottom-sheet-title-margin-vertical) var(--gap-4xl);
|
|
94
94
|
}
|
|
95
|
-
.bottom-
|
|
95
|
+
.bottom-sheet__titleIndentRight_grajk {
|
|
96
96
|
margin-right: var(--gap-4xl);
|
|
97
97
|
}
|
|
98
|
-
.bottom-
|
|
98
|
+
.bottom-sheet__titleIndentLeft_grajk {
|
|
99
99
|
margin-left: var(--gap-4xl);
|
|
100
100
|
}
|
package/esm/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1sm5t */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
--color-light-graphic-quaternary: #dbdee1;
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
--bottom-sheet-in-transition: 0.5s cubic-bezier(0.09, 0.91, 0.18, 0.99);
|
|
25
25
|
--bottom-sheet-out-transition: 0.3s ease;
|
|
26
26
|
}
|
|
27
|
-
.bottom-
|
|
27
|
+
.bottom-sheet__modal_1jz80 {
|
|
28
28
|
background-color: transparent;
|
|
29
29
|
position: fixed;
|
|
30
30
|
bottom: 0;
|
|
31
31
|
width: 100%;
|
|
32
32
|
max-width: 600px;
|
|
33
33
|
}
|
|
34
|
-
.bottom-
|
|
34
|
+
.bottom-sheet__component_1jz80 {
|
|
35
35
|
overflow: hidden;
|
|
36
36
|
position: relative;
|
|
37
37
|
display: flex;
|
|
@@ -41,20 +41,17 @@
|
|
|
41
41
|
background: var(--color-light-bg-primary);
|
|
42
42
|
transform: translateY(100%);
|
|
43
43
|
}
|
|
44
|
-
.bottom-
|
|
44
|
+
.bottom-sheet__withTransition_1jz80 {
|
|
45
45
|
transition: var(--bottom-sheet-out-transition);
|
|
46
46
|
}
|
|
47
|
-
.bottom-
|
|
48
|
-
transition: 0s linear;
|
|
49
|
-
}
|
|
50
|
-
.bottom-sheet__scrollableContainer_16hzh {
|
|
47
|
+
.bottom-sheet__scrollableContainer_1jz80 {
|
|
51
48
|
overflow: auto;
|
|
52
49
|
display: flex;
|
|
53
50
|
flex-direction: column;
|
|
54
51
|
position: relative;
|
|
55
52
|
height: 100%;
|
|
56
53
|
}
|
|
57
|
-
.bottom-
|
|
54
|
+
.bottom-sheet__marker_1jz80 {
|
|
58
55
|
position: fixed;
|
|
59
56
|
top: var(--gap-2xs);
|
|
60
57
|
left: 50%;
|
|
@@ -65,7 +62,7 @@
|
|
|
65
62
|
background-color: var(--color-light-graphic-quaternary);
|
|
66
63
|
z-index: 1000;
|
|
67
64
|
}
|
|
68
|
-
.bottom-
|
|
65
|
+
.bottom-sheet__content_1jz80 {
|
|
69
66
|
display: flex;
|
|
70
67
|
flex-direction: column;
|
|
71
68
|
flex: 1;
|
|
@@ -73,29 +70,29 @@
|
|
|
73
70
|
color: var(--color-light-text-primary);
|
|
74
71
|
background-color: var(--color-light-bg-primary);
|
|
75
72
|
}
|
|
76
|
-
.bottom-
|
|
73
|
+
.bottom-sheet__noHeader_1jz80 {
|
|
77
74
|
padding-top: var(--gap-xl);
|
|
78
75
|
}
|
|
79
|
-
.bottom-
|
|
76
|
+
.bottom-sheet__noFooter_1jz80 {
|
|
80
77
|
padding-bottom: var(--gap-m);
|
|
81
78
|
}
|
|
82
|
-
.bottom-
|
|
79
|
+
.bottom-sheet__scrollLocked_1jz80 {
|
|
83
80
|
overflow: hidden;
|
|
84
81
|
}
|
|
85
|
-
.bottom-
|
|
82
|
+
.bottom-sheet__appear_1jz80 .bottom-sheet__component_1jz80, .bottom-sheet__enter_1jz80 .bottom-sheet__component_1jz80 {
|
|
86
83
|
transition: none;
|
|
87
84
|
}
|
|
88
|
-
.bottom-
|
|
85
|
+
.bottom-sheet__appearActive_1jz80 .bottom-sheet__component_1jz80, .bottom-sheet__enterActive_1jz80 .bottom-sheet__component_1jz80 {
|
|
89
86
|
transition: var(--bottom-sheet-in-transition);
|
|
90
87
|
transform: translateY(0);
|
|
91
88
|
}
|
|
92
|
-
.bottom-
|
|
89
|
+
.bottom-sheet__enterDone_1jz80 .bottom-sheet__component_1jz80, .bottom-sheet__appearDone_1jz80 .bottom-sheet__component_1jz80 {
|
|
93
90
|
transform: translateY(0);
|
|
94
91
|
}
|
|
95
|
-
.bottom-
|
|
92
|
+
.bottom-sheet__exit_1jz80 .bottom-sheet__component_1jz80 {
|
|
96
93
|
transform: translateY(0);
|
|
97
94
|
}
|
|
98
|
-
.bottom-
|
|
95
|
+
.bottom-sheet__exitActive_1jz80 .bottom-sheet__component_1jz80 {
|
|
99
96
|
transition: var(--bottom-sheet-out-transition);
|
|
100
97
|
transform: translateY(100%);
|
|
101
98
|
}
|
package/esm/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./component-
|
|
1
|
+
export * from "./component-4ca72d9c";
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import './tslib.es6-
|
|
1
|
+
import './tslib.es6-4793cff0.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
4
|
import 'react-div-100vh';
|
|
@@ -10,7 +10,7 @@ import '@alfalab/icons-glyph/CrossMIcon';
|
|
|
10
10
|
import './components/closer/Component.js';
|
|
11
11
|
import '@alfalab/icons-glyph/ArrowBackMIcon';
|
|
12
12
|
import './components/backer/Component.js';
|
|
13
|
-
export { B as BottomSheet, C as CLOSE_OFFSET, H as HEADER_OFFSET } from './component-
|
|
13
|
+
export { B as BottomSheet, C as CLOSE_OFFSET, H as HEADER_OFFSET } from './component-4ca72d9c.js';
|
|
14
14
|
import './components/footer/Component.js';
|
|
15
15
|
import '@alfalab/core-components-backdrop/esm';
|
|
16
16
|
import './components/swipeable-backdrop/Component.js';
|
|
File without changes
|
|
File without changes
|
package/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1sm5t */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
--color-light-graphic-quaternary: #dbdee1;
|
|
@@ -24,14 +24,14 @@
|
|
|
24
24
|
--bottom-sheet-in-transition: 0.5s cubic-bezier(0.09, 0.91, 0.18, 0.99);
|
|
25
25
|
--bottom-sheet-out-transition: 0.3s ease;
|
|
26
26
|
}
|
|
27
|
-
.bottom-
|
|
27
|
+
.bottom-sheet__modal_1jz80 {
|
|
28
28
|
background-color: transparent;
|
|
29
29
|
position: fixed;
|
|
30
30
|
bottom: 0;
|
|
31
31
|
width: 100%;
|
|
32
32
|
max-width: 600px;
|
|
33
33
|
}
|
|
34
|
-
.bottom-
|
|
34
|
+
.bottom-sheet__component_1jz80 {
|
|
35
35
|
overflow: hidden;
|
|
36
36
|
position: relative;
|
|
37
37
|
display: flex;
|
|
@@ -41,20 +41,17 @@
|
|
|
41
41
|
background: var(--color-light-bg-primary);
|
|
42
42
|
transform: translateY(100%);
|
|
43
43
|
}
|
|
44
|
-
.bottom-
|
|
44
|
+
.bottom-sheet__withTransition_1jz80 {
|
|
45
45
|
transition: var(--bottom-sheet-out-transition);
|
|
46
46
|
}
|
|
47
|
-
.bottom-
|
|
48
|
-
transition: 0s linear;
|
|
49
|
-
}
|
|
50
|
-
.bottom-sheet__scrollableContainer_16hzh {
|
|
47
|
+
.bottom-sheet__scrollableContainer_1jz80 {
|
|
51
48
|
overflow: auto;
|
|
52
49
|
display: flex;
|
|
53
50
|
flex-direction: column;
|
|
54
51
|
position: relative;
|
|
55
52
|
height: 100%;
|
|
56
53
|
}
|
|
57
|
-
.bottom-
|
|
54
|
+
.bottom-sheet__marker_1jz80 {
|
|
58
55
|
position: fixed;
|
|
59
56
|
top: var(--gap-2xs);
|
|
60
57
|
left: 50%;
|
|
@@ -65,7 +62,7 @@
|
|
|
65
62
|
background-color: var(--color-light-graphic-quaternary);
|
|
66
63
|
z-index: 1000;
|
|
67
64
|
}
|
|
68
|
-
.bottom-
|
|
65
|
+
.bottom-sheet__content_1jz80 {
|
|
69
66
|
display: flex;
|
|
70
67
|
flex-direction: column;
|
|
71
68
|
flex: 1;
|
|
@@ -73,29 +70,29 @@
|
|
|
73
70
|
color: var(--color-light-text-primary);
|
|
74
71
|
background-color: var(--color-light-bg-primary);
|
|
75
72
|
}
|
|
76
|
-
.bottom-
|
|
73
|
+
.bottom-sheet__noHeader_1jz80 {
|
|
77
74
|
padding-top: var(--gap-xl);
|
|
78
75
|
}
|
|
79
|
-
.bottom-
|
|
76
|
+
.bottom-sheet__noFooter_1jz80 {
|
|
80
77
|
padding-bottom: var(--gap-m);
|
|
81
78
|
}
|
|
82
|
-
.bottom-
|
|
79
|
+
.bottom-sheet__scrollLocked_1jz80 {
|
|
83
80
|
overflow: hidden;
|
|
84
81
|
}
|
|
85
|
-
.bottom-
|
|
82
|
+
.bottom-sheet__appear_1jz80 .bottom-sheet__component_1jz80, .bottom-sheet__enter_1jz80 .bottom-sheet__component_1jz80 {
|
|
86
83
|
transition: none;
|
|
87
84
|
}
|
|
88
|
-
.bottom-
|
|
85
|
+
.bottom-sheet__appearActive_1jz80 .bottom-sheet__component_1jz80, .bottom-sheet__enterActive_1jz80 .bottom-sheet__component_1jz80 {
|
|
89
86
|
transition: var(--bottom-sheet-in-transition);
|
|
90
87
|
transform: translateY(0);
|
|
91
88
|
}
|
|
92
|
-
.bottom-
|
|
89
|
+
.bottom-sheet__enterDone_1jz80 .bottom-sheet__component_1jz80, .bottom-sheet__appearDone_1jz80 .bottom-sheet__component_1jz80 {
|
|
93
90
|
transform: translateY(0);
|
|
94
91
|
}
|
|
95
|
-
.bottom-
|
|
92
|
+
.bottom-sheet__exit_1jz80 .bottom-sheet__component_1jz80 {
|
|
96
93
|
transform: translateY(0);
|
|
97
94
|
}
|
|
98
|
-
.bottom-
|
|
95
|
+
.bottom-sheet__exitActive_1jz80 .bottom-sheet__component_1jz80 {
|
|
99
96
|
transition: var(--bottom-sheet-out-transition);
|
|
100
97
|
transform: translateY(100%);
|
|
101
98
|
}
|
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./component-
|
|
1
|
+
export * from "./component-781ae88d";
|
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('./tslib.es6-
|
|
5
|
+
require('./tslib.es6-86a36c7d.js');
|
|
6
6
|
require('react');
|
|
7
7
|
require('classnames');
|
|
8
8
|
require('react-div-100vh');
|
|
@@ -14,7 +14,7 @@ require('@alfalab/icons-glyph/CrossMIcon');
|
|
|
14
14
|
require('./components/closer/Component.js');
|
|
15
15
|
require('@alfalab/icons-glyph/ArrowBackMIcon');
|
|
16
16
|
require('./components/backer/Component.js');
|
|
17
|
-
var components_header_Component = require('./component-
|
|
17
|
+
var components_header_Component = require('./component-781ae88d.js');
|
|
18
18
|
require('./components/footer/Component.js');
|
|
19
19
|
require('@alfalab/core-components-backdrop');
|
|
20
20
|
require('./components/swipeable-backdrop/Component.js');
|
|
@@ -58,12 +58,17 @@ type HeaderProps = {
|
|
|
58
58
|
* Фиксирует шапку
|
|
59
59
|
*/
|
|
60
60
|
sticky?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
63
|
+
*/
|
|
64
|
+
dataTestId?: string;
|
|
61
65
|
/**
|
|
62
66
|
* Обработчик нажатия на стрелку назад
|
|
63
67
|
*/
|
|
64
68
|
onBack?: () => void;
|
|
65
69
|
};
|
|
66
70
|
declare const Header: FC<HeaderProps>;
|
|
71
|
+
declare const getDataTestId: (dataTestId?: string | undefined, element?: string | undefined) => string | undefined;
|
|
67
72
|
type BottomSheetTitleAlign$0 = 'center' | 'left';
|
|
68
73
|
type BottomSheetProps = {
|
|
69
74
|
/**
|
|
@@ -200,6 +205,7 @@ type BottomSheetProps = {
|
|
|
200
205
|
*/
|
|
201
206
|
disableBlockingScroll?: boolean;
|
|
202
207
|
/**
|
|
208
|
+
* @deprecated данный проп больше не используется, временно оставлен для обратной совместимости
|
|
203
209
|
* Не анимировать шторку при изменении размера вьюпорта
|
|
204
210
|
*/
|
|
205
211
|
ignoreScreenChange?: boolean;
|
|
@@ -219,4 +225,4 @@ type BottomSheetProps = {
|
|
|
219
225
|
declare const HEADER_OFFSET = 24;
|
|
220
226
|
declare const CLOSE_OFFSET = 0.2;
|
|
221
227
|
declare const BottomSheet: React.ForwardRefExoticComponent<BottomSheetProps & React.RefAttributes<HTMLDivElement>>;
|
|
222
|
-
export { HeaderProps, Header, BottomSheetTitleAlign$0 as BottomSheetTitleAlign, BottomSheetProps, HEADER_OFFSET, CLOSE_OFFSET, BottomSheet };
|
|
228
|
+
export { HeaderProps, Header, getDataTestId, BottomSheetTitleAlign$0 as BottomSheetTitleAlign, BottomSheetProps, HEADER_OFFSET, CLOSE_OFFSET, BottomSheet };
|
|
@@ -9,10 +9,15 @@ import { Backer } from './components/backer/Component.js';
|
|
|
9
9
|
import { Footer } from './components/footer/Component.js';
|
|
10
10
|
import { SwipeableBackdrop } from './components/swipeable-backdrop/Component.js';
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const getDataTestId = (dataTestId, element) => {
|
|
13
|
+
const elementPart = element ? `-${element.toLowerCase()}` : '';
|
|
14
|
+
return dataTestId ? `${dataTestId}${elementPart}` : undefined;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
var styles = {"headerWrapper":"bottom-sheet__headerWrapper_grajk","header":"bottom-sheet__header_grajk","sticky":"bottom-sheet__sticky_grajk","highlighted":"bottom-sheet__highlighted_grajk","justifyEnd":"bottom-sheet__justifyEnd_grajk","addon":"bottom-sheet__addon_grajk","addonFixed":"bottom-sheet__addonFixed_grajk","addonLeft":"bottom-sheet__addonLeft_grajk","addonRight":"bottom-sheet__addonRight_grajk","title":"bottom-sheet__title_grajk","titleCenter":"bottom-sheet__titleCenter_grajk","titleLeft":"bottom-sheet__titleLeft_grajk","trimTitle":"bottom-sheet__trimTitle_grajk","titleBigIndentHorizontal":"bottom-sheet__titleBigIndentHorizontal_grajk","titleIndentRight":"bottom-sheet__titleIndentRight_grajk","titleIndentLeft":"bottom-sheet__titleIndentLeft_grajk"};
|
|
13
18
|
require('./components/header/index.css')
|
|
14
19
|
|
|
15
|
-
const Header = ({ title, headerClassName, addonClassName, closerClassName, backerClassName, leftAddons, rightAddons, bottomAddons, hasCloser, hasBacker, titleAlign, trimTitle, sticky, onBack, }) => {
|
|
20
|
+
const Header = ({ title, headerClassName, addonClassName, closerClassName, backerClassName, leftAddons, rightAddons, bottomAddons, hasCloser, hasBacker, titleAlign, trimTitle, sticky, dataTestId, onBack, }) => {
|
|
16
21
|
const { headerHighlighted, setHasHeader, setHeaderOffset } = useContext(BaseModalContext);
|
|
17
22
|
const hasLeftPart = hasBacker || leftAddons || titleAlign === 'center';
|
|
18
23
|
const hasRightPart = hasCloser || rightAddons || titleAlign === 'center';
|
|
@@ -36,27 +41,27 @@ const Header = ({ title, headerClassName, addonClassName, closerClassName, backe
|
|
|
36
41
|
return (React.createElement("div", { className: cn(styles.headerWrapper, headerClassName, {
|
|
37
42
|
[styles.highlighted]: headerHighlighted && sticky,
|
|
38
43
|
[styles.sticky]: sticky,
|
|
39
|
-
}) },
|
|
44
|
+
}), "data-test-id": getDataTestId(dataTestId) },
|
|
40
45
|
React.createElement("div", { className: cn(styles.header, headerClassName, {
|
|
41
46
|
[styles.justifyEnd]: !title,
|
|
42
47
|
}) },
|
|
43
48
|
hasLeftPart && (React.createElement("div", { className: cn(styles.addon, addonClassName, {
|
|
44
49
|
[styles.addonFixed]: !sticky,
|
|
45
50
|
[styles.addonLeft]: !sticky,
|
|
46
|
-
}) }, hasBacker ? (React.createElement(Backer, { className: backerClassName, onClick: onBack })) : (leftAddons))),
|
|
51
|
+
}) }, hasBacker ? (React.createElement(Backer, { className: backerClassName, onClick: onBack, dataTestId: getDataTestId(dataTestId, 'backer') })) : (leftAddons))),
|
|
47
52
|
hasHeaderContent && (React.createElement(Typography.Text, { view: 'primary-large', weight: 'bold', className: cn(styles.title, getTitleIndent(), {
|
|
48
53
|
[styles.titleCenter]: titleAlign === 'center',
|
|
49
54
|
[styles.titleLeft]: titleAlign === 'left',
|
|
50
55
|
[styles.trimTitle]: trimTitle,
|
|
51
|
-
}), color: 'primary' }, title)),
|
|
56
|
+
}), color: 'primary', dataTestId: getDataTestId(dataTestId, 'title') }, title)),
|
|
52
57
|
hasRightPart && (React.createElement("div", { className: cn(styles.addon, addonClassName, {
|
|
53
58
|
[styles.addonFixed]: !sticky,
|
|
54
59
|
[styles.addonRight]: !sticky,
|
|
55
|
-
}) }, hasCloser ? React.createElement(Closer, { className: closerClassName }) : rightAddons))),
|
|
60
|
+
}) }, hasCloser ? (React.createElement(Closer, { className: closerClassName, dataTestId: getDataTestId(dataTestId, 'closer') })) : (rightAddons)))),
|
|
56
61
|
bottomAddons));
|
|
57
62
|
};
|
|
58
63
|
|
|
59
|
-
var styles$1 = {"modal":"bottom-
|
|
64
|
+
var styles$1 = {"modal":"bottom-sheet__modal_1jz80","component":"bottom-sheet__component_1jz80","withTransition":"bottom-sheet__withTransition_1jz80","scrollableContainer":"bottom-sheet__scrollableContainer_1jz80","marker":"bottom-sheet__marker_1jz80","content":"bottom-sheet__content_1jz80","noHeader":"bottom-sheet__noHeader_1jz80","noFooter":"bottom-sheet__noFooter_1jz80","scrollLocked":"bottom-sheet__scrollLocked_1jz80","appear":"bottom-sheet__appear_1jz80","enter":"bottom-sheet__enter_1jz80","appearActive":"bottom-sheet__appearActive_1jz80","enterActive":"bottom-sheet__enterActive_1jz80","enterDone":"bottom-sheet__enterDone_1jz80","appearDone":"bottom-sheet__appearDone_1jz80","exit":"bottom-sheet__exit_1jz80","exitActive":"bottom-sheet__exitActive_1jz80"};
|
|
60
65
|
require('./index.css')
|
|
61
66
|
|
|
62
67
|
const TIMEOUT = 300;
|
|
@@ -67,7 +72,7 @@ const MARKET_HEIGHT = 24;
|
|
|
67
72
|
/* Верхний отступ шторки, если она открыта на максимальную высоту */
|
|
68
73
|
const HEADER_OFFSET = 24;
|
|
69
74
|
const CLOSE_OFFSET = 0.2;
|
|
70
|
-
const BottomSheet = forwardRef(({ open, title, actionButton, contentClassName, containerClassName, containerProps, headerClassName, footerClassName, addonClassName, closerClassName, backerClassName, modalClassName, modalWrapperClassName, className, leftAddons, rightAddons, bottomAddons, hasCloser, hasBacker, titleAlign = 'left', trimTitle, stickyHeader, stickyFooter = true, initialHeight = 'default', hideOverlay, hideHeader, disableOverlayClick, disableBlockingScroll, children, zIndex, transitionProps = {}, dataTestId, swipeable = true,
|
|
75
|
+
const BottomSheet = forwardRef(({ open, title, actionButton, contentClassName, containerClassName, containerProps, headerClassName, footerClassName, addonClassName, closerClassName, backerClassName, modalClassName, modalWrapperClassName, className, leftAddons, rightAddons, bottomAddons, hasCloser, hasBacker, titleAlign = 'left', trimTitle, stickyHeader, stickyFooter = true, initialHeight = 'default', hideOverlay, hideHeader, disableOverlayClick, disableBlockingScroll, children, zIndex, transitionProps = {}, dataTestId, swipeable = true, backdropProps, onClose, onBack, }, ref) => {
|
|
71
76
|
const [sheetOffset, setSheetOffset] = useState(0);
|
|
72
77
|
const [backdropOpacity, setBackdropOpacity] = useState(1);
|
|
73
78
|
const [scrollLocked, setScrollLocked] = useState(false);
|
|
@@ -75,7 +80,6 @@ const BottomSheet = forwardRef(({ open, title, actionButton, contentClassName, c
|
|
|
75
80
|
const scrollableContainer = useRef(null);
|
|
76
81
|
const scrollableContainerScrollValue = useRef(0);
|
|
77
82
|
const emptyHeader = !hasCloser && !hasBacker && !leftAddons && !rightAddons && !title;
|
|
78
|
-
const [transitionClassName, setTransitionClassName] = useState(styles$1.withTransition);
|
|
79
83
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
80
84
|
const fullHeight = use100vh();
|
|
81
85
|
const targetHeight = `${fullHeight - HEADER_OFFSET}px`;
|
|
@@ -93,6 +97,7 @@ const BottomSheet = forwardRef(({ open, title, actionButton, contentClassName, c
|
|
|
93
97
|
titleAlign,
|
|
94
98
|
trimTitle,
|
|
95
99
|
sticky: stickyHeader,
|
|
100
|
+
dataTestId: getDataTestId(dataTestId, 'header'),
|
|
96
101
|
onBack,
|
|
97
102
|
};
|
|
98
103
|
const getBackdropOpacity = (offset) => {
|
|
@@ -138,12 +143,6 @@ const BottomSheet = forwardRef(({ open, title, actionButton, contentClassName, c
|
|
|
138
143
|
onClose();
|
|
139
144
|
}
|
|
140
145
|
else {
|
|
141
|
-
/**
|
|
142
|
-
* Установить мгновенную анимацию шторке если она не закрыта при свайпе и установлен проп ignoreScreenChange
|
|
143
|
-
*/
|
|
144
|
-
if (ignoreScreenChange) {
|
|
145
|
-
setTransitionClassName(styles$1.withZeroTransition);
|
|
146
|
-
}
|
|
147
146
|
setSheetOffset(0);
|
|
148
147
|
setBackdropOpacity(1);
|
|
149
148
|
}
|
|
@@ -166,12 +165,6 @@ const BottomSheet = forwardRef(({ open, title, actionButton, contentClassName, c
|
|
|
166
165
|
*/
|
|
167
166
|
if (offset > 0) {
|
|
168
167
|
setScrollLocked(true);
|
|
169
|
-
/**
|
|
170
|
-
* Вернуть плавную анимацию шторке при свайпе
|
|
171
|
-
*/
|
|
172
|
-
if (transitionClassName === styles$1.withZeroTransition) {
|
|
173
|
-
setTransitionClassName(styles$1.withTransition);
|
|
174
|
-
}
|
|
175
168
|
}
|
|
176
169
|
};
|
|
177
170
|
const backdropSwipeablehandlers = useSwipeable({
|
|
@@ -205,10 +198,7 @@ const BottomSheet = forwardRef(({ open, title, actionButton, contentClassName, c
|
|
|
205
198
|
if (!open) {
|
|
206
199
|
setSheetOffset(0);
|
|
207
200
|
}
|
|
208
|
-
|
|
209
|
-
setTransitionClassName(styles$1.withZeroTransition);
|
|
210
|
-
}
|
|
211
|
-
}, [open, ignoreScreenChange]);
|
|
201
|
+
}, [open]);
|
|
212
202
|
const getSwipeStyles = () => ({
|
|
213
203
|
transform: sheetOffset ? `translateY(${sheetOffset}px)` : '',
|
|
214
204
|
});
|
|
@@ -230,22 +220,23 @@ const BottomSheet = forwardRef(({ open, title, actionButton, contentClassName, c
|
|
|
230
220
|
onExited: handleExited,
|
|
231
221
|
onEntered: handleEntered,
|
|
232
222
|
} },
|
|
233
|
-
React.createElement("div",
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
223
|
+
React.createElement("div", { style: { ...getHeightStyles() } },
|
|
224
|
+
React.createElement("div", Object.assign({ className: cn(styles$1.component, className, {
|
|
225
|
+
[styles$1.withTransition]: !sheetOffset,
|
|
226
|
+
}), style: {
|
|
227
|
+
...getSwipeStyles(),
|
|
228
|
+
...getHeightStyles(),
|
|
229
|
+
} }, sheetSwipeablehandlers),
|
|
230
|
+
React.createElement("div", Object.assign({}, containerProps, { className: cn(styles$1.scrollableContainer, containerProps?.className, containerClassName, {
|
|
231
|
+
[styles$1.scrollLocked]: scrollLocked,
|
|
232
|
+
}), ref: scrollableContainer }),
|
|
233
|
+
swipeable && React.createElement("div", { className: cn(styles$1.marker) }),
|
|
234
|
+
!hideHeader && !emptyHeader && React.createElement(Header, Object.assign({}, headerProps)),
|
|
235
|
+
React.createElement("div", { className: cn(styles$1.content, contentClassName, {
|
|
236
|
+
[styles$1.noHeader]: hideHeader || emptyHeader,
|
|
237
|
+
[styles$1.noFooter]: !actionButton,
|
|
238
|
+
}) }, children),
|
|
239
|
+
actionButton && (React.createElement(Footer, { sticky: stickyFooter, className: footerClassName }, actionButton)))))));
|
|
249
240
|
});
|
|
250
241
|
|
|
251
242
|
export { BottomSheet as B, CLOSE_OFFSET as C, HEADER_OFFSET as H, Header as a };
|
package/modern/component.js
CHANGED
|
@@ -9,7 +9,7 @@ import '@alfalab/icons-glyph/CrossMIcon';
|
|
|
9
9
|
import './components/closer/Component.js';
|
|
10
10
|
import '@alfalab/icons-glyph/ArrowBackMIcon';
|
|
11
11
|
import './components/backer/Component.js';
|
|
12
|
-
export { B as BottomSheet, C as CLOSE_OFFSET, H as HEADER_OFFSET } from './component-
|
|
12
|
+
export { B as BottomSheet, C as CLOSE_OFFSET, H as HEADER_OFFSET } from './component-d444787d.js';
|
|
13
13
|
import './components/footer/Component.js';
|
|
14
14
|
import '@alfalab/core-components-backdrop/modern';
|
|
15
15
|
import './components/swipeable-backdrop/Component.js';
|
|
@@ -3,12 +3,12 @@ import cn from 'classnames';
|
|
|
3
3
|
import { IconButton } from '@alfalab/core-components-icon-button/modern';
|
|
4
4
|
import { ArrowBackMIcon } from '@alfalab/icons-glyph/ArrowBackMIcon';
|
|
5
5
|
|
|
6
|
-
var styles = {"backer":"bottom-
|
|
6
|
+
var styles = {"backer":"bottom-sheet__backer_1uutm","button":"bottom-sheet__button_1uutm"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
|
-
const Backer = ({ className, size = 'xs', icon = ArrowBackMIcon, onClick, ...restProps }) => {
|
|
9
|
+
const Backer = ({ className, size = 'xs', icon = ArrowBackMIcon, dataTestId, onClick, ...restProps }) => {
|
|
10
10
|
return (React.createElement("div", { className: cn(styles.backer, className) },
|
|
11
|
-
React.createElement(IconButton, Object.assign({ size: size, className: styles.button, "aria-label": '\u043D\u0430\u0437\u0430\u0434', onClick: onClick, icon: icon }, restProps))));
|
|
11
|
+
React.createElement(IconButton, Object.assign({ size: size, className: styles.button, "aria-label": '\u043D\u0430\u0437\u0430\u0434', onClick: onClick, icon: icon, dataTestId: dataTestId }, restProps))));
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export { Backer };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: gaaii */
|
|
2
2
|
:root {
|
|
3
3
|
--bottom-sheet-backer-bg-color: var(--color-light-bg-primary-inverted-alpha-3);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.bottom-
|
|
6
|
+
.bottom-sheet__backer_1uutm {
|
|
7
7
|
width: 32px;
|
|
8
8
|
height: 32px;
|
|
9
9
|
display: flex;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
color: var(--color-light-graphic-primary);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.bottom-
|
|
16
|
+
.bottom-sheet__button_1uutm {
|
|
17
17
|
background: var(--bottom-sheet-backer-bg-color);
|
|
18
18
|
-webkit-backdrop-filter: blur(10px);
|
|
19
19
|
backdrop-filter: blur(10px);
|