@alfalab/core-components-bottom-sheet 6.7.1 → 6.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/component.js +13 -11
- package/components/footer/Component.js +1 -1
- package/components/footer/index.css +26 -26
- package/components/header/Component.js +1 -1
- package/components/header/index.css +13 -13
- package/cssm/component.js +12 -10
- package/cssm/types.d.ts +5 -0
- package/esm/component.js +14 -12
- package/esm/components/footer/Component.js +1 -1
- package/esm/components/footer/index.css +26 -26
- package/esm/components/header/Component.js +1 -1
- package/esm/components/header/index.css +13 -13
- package/esm/index.css +43 -43
- package/esm/types.d.ts +5 -0
- package/index.css +43 -43
- package/modern/component.js +13 -12
- package/modern/components/footer/Component.js +1 -1
- package/modern/components/footer/index.css +26 -26
- package/modern/components/header/Component.js +1 -1
- package/modern/components/header/index.css +13 -13
- package/modern/index.css +43 -43
- package/modern/types.d.ts +5 -0
- package/package.json +3 -3
- package/src/component.tsx +13 -17
- package/src/types.ts +6 -0
- package/types.d.ts +5 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1x5qy */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-border-secondary: #e9e9eb; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* 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,42 +27,42 @@
|
|
|
27
27
|
--bottom-sheet-title-font-weight: 700;
|
|
28
28
|
--bottom-sheet-title-line-height: 24px;
|
|
29
29
|
--bottom-sheet-title-font-family: var(--font-family-system);
|
|
30
|
-
} .bottom-
|
|
30
|
+
} .bottom-sheet__headerWrapper_198ve {
|
|
31
31
|
padding: var(--gap-s) var(--gap-xs) var(--gap-2xs);
|
|
32
32
|
border-top-right-radius: var(--border-radius-xl);
|
|
33
33
|
border-top-left-radius: var(--border-radius-xl);
|
|
34
34
|
z-index: 1;
|
|
35
|
-
} .bottom-
|
|
35
|
+
} .bottom-sheet__hasContent_198ve {
|
|
36
36
|
background-color: inherit;
|
|
37
|
-
} .bottom-
|
|
37
|
+
} .bottom-sheet__header_198ve {
|
|
38
38
|
display: flex;
|
|
39
|
-
} .bottom-
|
|
39
|
+
} .bottom-sheet__sticky_198ve {
|
|
40
40
|
position: sticky;
|
|
41
41
|
top: 0;
|
|
42
|
-
} .bottom-
|
|
42
|
+
} .bottom-sheet__highlighted_198ve {
|
|
43
43
|
border-bottom: var(--bottom-sheet-header-border-bottom);
|
|
44
|
-
} .bottom-
|
|
44
|
+
} .bottom-sheet__justifyEnd_198ve {
|
|
45
45
|
justify-content: flex-end;
|
|
46
|
-
} .bottom-
|
|
46
|
+
} .bottom-sheet__addon_198ve {
|
|
47
47
|
display: flex;
|
|
48
48
|
justify-content: center;
|
|
49
49
|
align-items: center;
|
|
50
50
|
min-width: 48px;
|
|
51
51
|
height: 48px;
|
|
52
|
-
} .bottom-
|
|
52
|
+
} .bottom-sheet__addonFixed_198ve {
|
|
53
53
|
position: fixed;
|
|
54
|
-
} .bottom-
|
|
54
|
+
} .bottom-sheet__title_198ve {
|
|
55
55
|
padding: var(--gap-s) var(--gap-xs);
|
|
56
56
|
width: 100%;
|
|
57
57
|
font-size: var(--bottom-sheet-title-font-size);
|
|
58
58
|
font-weight: var(--bottom-sheet-title-font-weight);
|
|
59
59
|
line-height: var(--bottom-sheet-title-line-height);
|
|
60
60
|
font-family: var(--bottom-sheet-title-font-family);
|
|
61
|
-
} .bottom-
|
|
61
|
+
} .bottom-sheet__titleCenter_198ve {
|
|
62
62
|
text-align: center;
|
|
63
|
-
} .bottom-
|
|
63
|
+
} .bottom-sheet__titleLeft_198ve {
|
|
64
64
|
text-align: left;
|
|
65
|
-
} .bottom-
|
|
65
|
+
} .bottom-sheet__trimTitle_198ve {
|
|
66
66
|
white-space: nowrap;
|
|
67
67
|
overflow: hidden;
|
|
68
68
|
text-overflow: ellipsis;
|
package/esm/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: okunf */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-accent: #ef3124;
|
|
@@ -45,31 +45,31 @@
|
|
|
45
45
|
} :root {
|
|
46
46
|
--bottom-sheet-in-transition: transform 0.5s cubic-bezier(0.09, 0.91, 0.18, 0.99);
|
|
47
47
|
--bottom-sheet-out-transition: transform 0.3s ease;
|
|
48
|
-
} .bottom-
|
|
48
|
+
} .bottom-sheet__modal_88g3f {
|
|
49
49
|
background-color: transparent;
|
|
50
50
|
position: fixed;
|
|
51
51
|
bottom: 0;
|
|
52
52
|
width: 100%;
|
|
53
53
|
max-width: 600px;
|
|
54
54
|
pointer-events: none;
|
|
55
|
-
} .bottom-
|
|
55
|
+
} .bottom-sheet__wrapper_88g3f {
|
|
56
56
|
transform: translateY(100%);
|
|
57
57
|
pointer-events: none;
|
|
58
58
|
border-top-right-radius: var(--border-radius-xl);
|
|
59
59
|
border-top-left-radius: var(--border-radius-xl);
|
|
60
60
|
transition: border-radius 0.3s ease;
|
|
61
|
-
} .bottom-
|
|
61
|
+
} .bottom-sheet__fullscreen_88g3f {
|
|
62
62
|
border-radius: 0;
|
|
63
|
-
} .bottom-
|
|
63
|
+
} .bottom-sheet__component_88g3f {
|
|
64
64
|
position: relative;
|
|
65
65
|
display: flex;
|
|
66
66
|
flex-direction: column;
|
|
67
67
|
border-radius: inherit;
|
|
68
68
|
background-color: var(--color-light-bg-primary);
|
|
69
69
|
pointer-events: all;
|
|
70
|
-
} .bottom-
|
|
70
|
+
} .bottom-sheet__withTransition_88g3f {
|
|
71
71
|
transition: var(--bottom-sheet-out-transition);
|
|
72
|
-
} .bottom-
|
|
72
|
+
} .bottom-sheet__scrollableContainer_88g3f {
|
|
73
73
|
overflow: auto;
|
|
74
74
|
display: flex;
|
|
75
75
|
flex-direction: column;
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
height: 100%;
|
|
78
78
|
background-color: inherit;
|
|
79
79
|
border-radius: inherit;
|
|
80
|
-
} .bottom-
|
|
80
|
+
} .bottom-sheet__marker_88g3f {
|
|
81
81
|
position: fixed;
|
|
82
82
|
top: var(--gap-2xs);
|
|
83
83
|
right: 0;
|
|
@@ -85,11 +85,11 @@
|
|
|
85
85
|
z-index: 1000;
|
|
86
86
|
width: 36px;
|
|
87
87
|
margin: 0 auto;
|
|
88
|
-
} .bottom-
|
|
88
|
+
} .bottom-sheet__defaultMarker_88g3f {
|
|
89
89
|
height: 4px;
|
|
90
90
|
border-radius: var(--border-radius-xxl);
|
|
91
91
|
background-color: var(--color-light-graphic-quaternary);
|
|
92
|
-
} .bottom-
|
|
92
|
+
} .bottom-sheet__content_88g3f {
|
|
93
93
|
position: relative;
|
|
94
94
|
z-index: 0;
|
|
95
95
|
display: flex;
|
|
@@ -98,73 +98,73 @@
|
|
|
98
98
|
padding: 0 var(--gap-m);
|
|
99
99
|
color: var(--color-light-text-primary);
|
|
100
100
|
background-color: inherit;
|
|
101
|
-
} .bottom-
|
|
101
|
+
} .bottom-sheet__noHeader_88g3f {
|
|
102
102
|
padding-top: var(--gap-m);
|
|
103
|
-
} .bottom-
|
|
103
|
+
} .bottom-sheet__noFooter_88g3f {
|
|
104
104
|
padding-bottom: var(--gap-m);
|
|
105
|
-
} .bottom-
|
|
105
|
+
} .bottom-sheet__scrollLocked_88g3f {
|
|
106
106
|
overflow: hidden;
|
|
107
|
-
} .bottom-
|
|
107
|
+
} .bottom-sheet__hiddenScrollbar_88g3f {
|
|
108
108
|
scrollbar-width: none
|
|
109
|
-
} .bottom-
|
|
109
|
+
} .bottom-sheet__hiddenScrollbar_88g3f::-webkit-scrollbar {
|
|
110
110
|
width: 0;
|
|
111
111
|
height: 0;
|
|
112
|
-
} .bottom-
|
|
112
|
+
} .bottom-sheet__disabledPointerEvents_88g3f {
|
|
113
113
|
pointer-events: none;
|
|
114
|
-
} .bottom-
|
|
114
|
+
} .bottom-sheet__appear_88g3f .bottom-sheet__wrapper_88g3f, .bottom-sheet__enter_88g3f .bottom-sheet__wrapper_88g3f {
|
|
115
115
|
transition: none;
|
|
116
|
-
} .bottom-
|
|
116
|
+
} .bottom-sheet__appearActive_88g3f .bottom-sheet__wrapper_88g3f, .bottom-sheet__enterActive_88g3f .bottom-sheet__wrapper_88g3f {
|
|
117
117
|
transition: var(--bottom-sheet-in-transition);
|
|
118
118
|
transform: translateY(0);
|
|
119
|
-
} .bottom-
|
|
119
|
+
} .bottom-sheet__enterDone_88g3f .bottom-sheet__wrapper_88g3f, .bottom-sheet__appearDone_88g3f .bottom-sheet__wrapper_88g3f {
|
|
120
120
|
transform: translateY(0);
|
|
121
|
-
} .bottom-
|
|
121
|
+
} .bottom-sheet__exit_88g3f .bottom-sheet__wrapper_88g3f {
|
|
122
122
|
transform: translateY(0);
|
|
123
|
-
} .bottom-
|
|
123
|
+
} .bottom-sheet__exitActive_88g3f .bottom-sheet__wrapper_88g3f {
|
|
124
124
|
transition: var(--bottom-sheet-out-transition);
|
|
125
125
|
transform: translateY(100%);
|
|
126
|
-
} .bottom-sheet__background-
|
|
126
|
+
} .bottom-sheet__background-accent_88g3f {
|
|
127
127
|
background-color: var(--color-light-bg-accent);
|
|
128
|
-
} .bottom-sheet__background-
|
|
128
|
+
} .bottom-sheet__background-info_88g3f {
|
|
129
129
|
background-color: var(--color-light-bg-info);
|
|
130
|
-
} .bottom-sheet__background-attention-
|
|
130
|
+
} .bottom-sheet__background-attention-muted_88g3f {
|
|
131
131
|
background-color: var(--color-light-bg-attention-muted);
|
|
132
|
-
} .bottom-sheet__background-positive-
|
|
132
|
+
} .bottom-sheet__background-positive-muted_88g3f {
|
|
133
133
|
background-color: var(--color-light-bg-positive-muted);
|
|
134
|
-
} .bottom-sheet__background-negative-
|
|
134
|
+
} .bottom-sheet__background-negative-muted_88g3f {
|
|
135
135
|
background-color: var(--color-light-bg-negative-muted);
|
|
136
|
-
} .bottom-sheet__background-
|
|
136
|
+
} .bottom-sheet__background-primary_88g3f {
|
|
137
137
|
background-color: var(--color-light-bg-primary);
|
|
138
|
-
} .bottom-sheet__background-primary-
|
|
138
|
+
} .bottom-sheet__background-primary-inverted_88g3f {
|
|
139
139
|
background-color: var(--color-light-bg-primary-inverted);
|
|
140
|
-
} .bottom-sheet__background-
|
|
140
|
+
} .bottom-sheet__background-secondary_88g3f {
|
|
141
141
|
background-color: var(--color-light-bg-secondary);
|
|
142
|
-
} .bottom-sheet__background-secondary-
|
|
142
|
+
} .bottom-sheet__background-secondary-inverted_88g3f {
|
|
143
143
|
background-color: var(--color-light-bg-secondary-inverted);
|
|
144
|
-
} .bottom-sheet__background-
|
|
144
|
+
} .bottom-sheet__background-tertiary_88g3f {
|
|
145
145
|
background-color: var(--color-light-bg-tertiary);
|
|
146
|
-
} .bottom-sheet__background-tertiary-
|
|
146
|
+
} .bottom-sheet__background-tertiary-inverted_88g3f {
|
|
147
147
|
background-color: var(--color-light-bg-tertiary-inverted);
|
|
148
|
-
} .bottom-sheet__background-
|
|
148
|
+
} .bottom-sheet__background-quaternary_88g3f {
|
|
149
149
|
background-color: var(--color-light-bg-quaternary);
|
|
150
|
-
} .bottom-sheet__background-quaternary-
|
|
150
|
+
} .bottom-sheet__background-quaternary-inverted_88g3f {
|
|
151
151
|
background-color: var(--color-light-bg-quaternary-inverted);
|
|
152
|
-
} .bottom-sheet__background-specialbg-
|
|
152
|
+
} .bottom-sheet__background-specialbg-component_88g3f {
|
|
153
153
|
background-color: var(--color-light-specialbg-component);
|
|
154
|
-
} .bottom-sheet__background-specialbg-component-
|
|
154
|
+
} .bottom-sheet__background-specialbg-component-inverted_88g3f {
|
|
155
155
|
background-color: var(--color-light-specialbg-component-inverted);
|
|
156
|
-
} .bottom-sheet__background-specialbg-primary-
|
|
156
|
+
} .bottom-sheet__background-specialbg-primary-grouped_88g3f {
|
|
157
157
|
background-color: var(--color-light-specialbg-primary-grouped);
|
|
158
|
-
} .bottom-sheet__background-specialbg-secondary-
|
|
158
|
+
} .bottom-sheet__background-specialbg-secondary-grouped_88g3f {
|
|
159
159
|
background-color: var(--color-light-specialbg-secondary-grouped);
|
|
160
|
-
} .bottom-sheet__background-specialbg-tertiary-
|
|
160
|
+
} .bottom-sheet__background-specialbg-tertiary-grouped_88g3f {
|
|
161
161
|
background-color: var(--color-light-specialbg-tertiary-grouped);
|
|
162
|
-
} .bottom-sheet__background-specialbg-secondary-
|
|
162
|
+
} .bottom-sheet__background-specialbg-secondary-transparent_88g3f {
|
|
163
163
|
background-color: var(--color-light-specialbg-secondary-transparent);
|
|
164
|
-
} .bottom-sheet__background-specialbg-secondary-transparent-
|
|
164
|
+
} .bottom-sheet__background-specialbg-secondary-transparent-inverted_88g3f {
|
|
165
165
|
background-color: var(--color-light-specialbg-secondary-transparent-inverted);
|
|
166
|
-
} .bottom-sheet__background-specialbg-tertiary-
|
|
166
|
+
} .bottom-sheet__background-specialbg-tertiary-transparent_88g3f {
|
|
167
167
|
background-color: var(--color-light-specialbg-tertiary-transparent);
|
|
168
|
-
} .bottom-sheet__background-specialbg-tertiary-transparent-
|
|
168
|
+
} .bottom-sheet__background-specialbg-tertiary-transparent-inverted_88g3f {
|
|
169
169
|
background-color: var(--color-light-specialbg-tertiary-transparent-inverted);
|
|
170
170
|
}
|
package/esm/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react-transition-group" />
|
|
2
2
|
import { HTMLAttributes, ReactElement, ReactNode, RefObject } from 'react';
|
|
3
|
+
import { HandledEvents } from 'react-swipeable/es/types';
|
|
3
4
|
import { TransitionProps } from 'react-transition-group/Transition';
|
|
4
5
|
import { BaseModalProps } from "@alfalab/core-components-base-modal";
|
|
5
6
|
import { NavigationBarProps } from "@alfalab/core-components-navigation-bar";
|
|
@@ -263,5 +264,9 @@ type BottomSheetProps = {
|
|
|
263
264
|
* Вызывается при изменении положения шторки
|
|
264
265
|
*/
|
|
265
266
|
onOffsetChange?: (offset: number, percent: number) => void;
|
|
267
|
+
/**
|
|
268
|
+
* Вызывается для событий touchend and mouseup.
|
|
269
|
+
*/
|
|
270
|
+
onTouchEnd?: (event: HandledEvents) => void;
|
|
266
271
|
};
|
|
267
272
|
export { BottomSheetTitleAlign, BottomSheetProps };
|
package/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: okunf */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-accent: #ef3124;
|
|
@@ -45,31 +45,31 @@
|
|
|
45
45
|
} :root {
|
|
46
46
|
--bottom-sheet-in-transition: transform 0.5s cubic-bezier(0.09, 0.91, 0.18, 0.99);
|
|
47
47
|
--bottom-sheet-out-transition: transform 0.3s ease;
|
|
48
|
-
} .bottom-
|
|
48
|
+
} .bottom-sheet__modal_88g3f {
|
|
49
49
|
background-color: transparent;
|
|
50
50
|
position: fixed;
|
|
51
51
|
bottom: 0;
|
|
52
52
|
width: 100%;
|
|
53
53
|
max-width: 600px;
|
|
54
54
|
pointer-events: none;
|
|
55
|
-
} .bottom-
|
|
55
|
+
} .bottom-sheet__wrapper_88g3f {
|
|
56
56
|
transform: translateY(100%);
|
|
57
57
|
pointer-events: none;
|
|
58
58
|
border-top-right-radius: var(--border-radius-xl);
|
|
59
59
|
border-top-left-radius: var(--border-radius-xl);
|
|
60
60
|
transition: border-radius 0.3s ease;
|
|
61
|
-
} .bottom-
|
|
61
|
+
} .bottom-sheet__fullscreen_88g3f {
|
|
62
62
|
border-radius: 0;
|
|
63
|
-
} .bottom-
|
|
63
|
+
} .bottom-sheet__component_88g3f {
|
|
64
64
|
position: relative;
|
|
65
65
|
display: flex;
|
|
66
66
|
flex-direction: column;
|
|
67
67
|
border-radius: inherit;
|
|
68
68
|
background-color: var(--color-light-bg-primary);
|
|
69
69
|
pointer-events: all;
|
|
70
|
-
} .bottom-
|
|
70
|
+
} .bottom-sheet__withTransition_88g3f {
|
|
71
71
|
transition: var(--bottom-sheet-out-transition);
|
|
72
|
-
} .bottom-
|
|
72
|
+
} .bottom-sheet__scrollableContainer_88g3f {
|
|
73
73
|
overflow: auto;
|
|
74
74
|
display: flex;
|
|
75
75
|
flex-direction: column;
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
height: 100%;
|
|
78
78
|
background-color: inherit;
|
|
79
79
|
border-radius: inherit;
|
|
80
|
-
} .bottom-
|
|
80
|
+
} .bottom-sheet__marker_88g3f {
|
|
81
81
|
position: fixed;
|
|
82
82
|
top: var(--gap-2xs);
|
|
83
83
|
right: 0;
|
|
@@ -85,11 +85,11 @@
|
|
|
85
85
|
z-index: 1000;
|
|
86
86
|
width: 36px;
|
|
87
87
|
margin: 0 auto;
|
|
88
|
-
} .bottom-
|
|
88
|
+
} .bottom-sheet__defaultMarker_88g3f {
|
|
89
89
|
height: 4px;
|
|
90
90
|
border-radius: var(--border-radius-xxl);
|
|
91
91
|
background-color: var(--color-light-graphic-quaternary);
|
|
92
|
-
} .bottom-
|
|
92
|
+
} .bottom-sheet__content_88g3f {
|
|
93
93
|
position: relative;
|
|
94
94
|
z-index: 0;
|
|
95
95
|
display: flex;
|
|
@@ -98,73 +98,73 @@
|
|
|
98
98
|
padding: 0 var(--gap-m);
|
|
99
99
|
color: var(--color-light-text-primary);
|
|
100
100
|
background-color: inherit;
|
|
101
|
-
} .bottom-
|
|
101
|
+
} .bottom-sheet__noHeader_88g3f {
|
|
102
102
|
padding-top: var(--gap-m);
|
|
103
|
-
} .bottom-
|
|
103
|
+
} .bottom-sheet__noFooter_88g3f {
|
|
104
104
|
padding-bottom: var(--gap-m);
|
|
105
|
-
} .bottom-
|
|
105
|
+
} .bottom-sheet__scrollLocked_88g3f {
|
|
106
106
|
overflow: hidden;
|
|
107
|
-
} .bottom-
|
|
107
|
+
} .bottom-sheet__hiddenScrollbar_88g3f {
|
|
108
108
|
scrollbar-width: none
|
|
109
|
-
} .bottom-
|
|
109
|
+
} .bottom-sheet__hiddenScrollbar_88g3f::-webkit-scrollbar {
|
|
110
110
|
width: 0;
|
|
111
111
|
height: 0;
|
|
112
|
-
} .bottom-
|
|
112
|
+
} .bottom-sheet__disabledPointerEvents_88g3f {
|
|
113
113
|
pointer-events: none;
|
|
114
|
-
} .bottom-
|
|
114
|
+
} .bottom-sheet__appear_88g3f .bottom-sheet__wrapper_88g3f, .bottom-sheet__enter_88g3f .bottom-sheet__wrapper_88g3f {
|
|
115
115
|
transition: none;
|
|
116
|
-
} .bottom-
|
|
116
|
+
} .bottom-sheet__appearActive_88g3f .bottom-sheet__wrapper_88g3f, .bottom-sheet__enterActive_88g3f .bottom-sheet__wrapper_88g3f {
|
|
117
117
|
transition: var(--bottom-sheet-in-transition);
|
|
118
118
|
transform: translateY(0);
|
|
119
|
-
} .bottom-
|
|
119
|
+
} .bottom-sheet__enterDone_88g3f .bottom-sheet__wrapper_88g3f, .bottom-sheet__appearDone_88g3f .bottom-sheet__wrapper_88g3f {
|
|
120
120
|
transform: translateY(0);
|
|
121
|
-
} .bottom-
|
|
121
|
+
} .bottom-sheet__exit_88g3f .bottom-sheet__wrapper_88g3f {
|
|
122
122
|
transform: translateY(0);
|
|
123
|
-
} .bottom-
|
|
123
|
+
} .bottom-sheet__exitActive_88g3f .bottom-sheet__wrapper_88g3f {
|
|
124
124
|
transition: var(--bottom-sheet-out-transition);
|
|
125
125
|
transform: translateY(100%);
|
|
126
|
-
} .bottom-sheet__background-
|
|
126
|
+
} .bottom-sheet__background-accent_88g3f {
|
|
127
127
|
background-color: var(--color-light-bg-accent);
|
|
128
|
-
} .bottom-sheet__background-
|
|
128
|
+
} .bottom-sheet__background-info_88g3f {
|
|
129
129
|
background-color: var(--color-light-bg-info);
|
|
130
|
-
} .bottom-sheet__background-attention-
|
|
130
|
+
} .bottom-sheet__background-attention-muted_88g3f {
|
|
131
131
|
background-color: var(--color-light-bg-attention-muted);
|
|
132
|
-
} .bottom-sheet__background-positive-
|
|
132
|
+
} .bottom-sheet__background-positive-muted_88g3f {
|
|
133
133
|
background-color: var(--color-light-bg-positive-muted);
|
|
134
|
-
} .bottom-sheet__background-negative-
|
|
134
|
+
} .bottom-sheet__background-negative-muted_88g3f {
|
|
135
135
|
background-color: var(--color-light-bg-negative-muted);
|
|
136
|
-
} .bottom-sheet__background-
|
|
136
|
+
} .bottom-sheet__background-primary_88g3f {
|
|
137
137
|
background-color: var(--color-light-bg-primary);
|
|
138
|
-
} .bottom-sheet__background-primary-
|
|
138
|
+
} .bottom-sheet__background-primary-inverted_88g3f {
|
|
139
139
|
background-color: var(--color-light-bg-primary-inverted);
|
|
140
|
-
} .bottom-sheet__background-
|
|
140
|
+
} .bottom-sheet__background-secondary_88g3f {
|
|
141
141
|
background-color: var(--color-light-bg-secondary);
|
|
142
|
-
} .bottom-sheet__background-secondary-
|
|
142
|
+
} .bottom-sheet__background-secondary-inverted_88g3f {
|
|
143
143
|
background-color: var(--color-light-bg-secondary-inverted);
|
|
144
|
-
} .bottom-sheet__background-
|
|
144
|
+
} .bottom-sheet__background-tertiary_88g3f {
|
|
145
145
|
background-color: var(--color-light-bg-tertiary);
|
|
146
|
-
} .bottom-sheet__background-tertiary-
|
|
146
|
+
} .bottom-sheet__background-tertiary-inverted_88g3f {
|
|
147
147
|
background-color: var(--color-light-bg-tertiary-inverted);
|
|
148
|
-
} .bottom-sheet__background-
|
|
148
|
+
} .bottom-sheet__background-quaternary_88g3f {
|
|
149
149
|
background-color: var(--color-light-bg-quaternary);
|
|
150
|
-
} .bottom-sheet__background-quaternary-
|
|
150
|
+
} .bottom-sheet__background-quaternary-inverted_88g3f {
|
|
151
151
|
background-color: var(--color-light-bg-quaternary-inverted);
|
|
152
|
-
} .bottom-sheet__background-specialbg-
|
|
152
|
+
} .bottom-sheet__background-specialbg-component_88g3f {
|
|
153
153
|
background-color: var(--color-light-specialbg-component);
|
|
154
|
-
} .bottom-sheet__background-specialbg-component-
|
|
154
|
+
} .bottom-sheet__background-specialbg-component-inverted_88g3f {
|
|
155
155
|
background-color: var(--color-light-specialbg-component-inverted);
|
|
156
|
-
} .bottom-sheet__background-specialbg-primary-
|
|
156
|
+
} .bottom-sheet__background-specialbg-primary-grouped_88g3f {
|
|
157
157
|
background-color: var(--color-light-specialbg-primary-grouped);
|
|
158
|
-
} .bottom-sheet__background-specialbg-secondary-
|
|
158
|
+
} .bottom-sheet__background-specialbg-secondary-grouped_88g3f {
|
|
159
159
|
background-color: var(--color-light-specialbg-secondary-grouped);
|
|
160
|
-
} .bottom-sheet__background-specialbg-tertiary-
|
|
160
|
+
} .bottom-sheet__background-specialbg-tertiary-grouped_88g3f {
|
|
161
161
|
background-color: var(--color-light-specialbg-tertiary-grouped);
|
|
162
|
-
} .bottom-sheet__background-specialbg-secondary-
|
|
162
|
+
} .bottom-sheet__background-specialbg-secondary-transparent_88g3f {
|
|
163
163
|
background-color: var(--color-light-specialbg-secondary-transparent);
|
|
164
|
-
} .bottom-sheet__background-specialbg-secondary-transparent-
|
|
164
|
+
} .bottom-sheet__background-specialbg-secondary-transparent-inverted_88g3f {
|
|
165
165
|
background-color: var(--color-light-specialbg-secondary-transparent-inverted);
|
|
166
|
-
} .bottom-sheet__background-specialbg-tertiary-
|
|
166
|
+
} .bottom-sheet__background-specialbg-tertiary-transparent_88g3f {
|
|
167
167
|
background-color: var(--color-light-specialbg-tertiary-transparent);
|
|
168
|
-
} .bottom-sheet__background-specialbg-tertiary-transparent-
|
|
168
|
+
} .bottom-sheet__background-specialbg-tertiary-transparent-inverted_88g3f {
|
|
169
169
|
background-color: var(--color-light-specialbg-tertiary-transparent-inverted);
|
|
170
170
|
}
|
package/modern/component.js
CHANGED
|
@@ -4,7 +4,7 @@ import mergeRefs from 'react-merge-refs';
|
|
|
4
4
|
import { useSwipeable } from 'react-swipeable';
|
|
5
5
|
import cn from 'classnames';
|
|
6
6
|
import { BaseModal } from '@alfalab/core-components-base-modal/modern';
|
|
7
|
-
import { getDataTestId } from '@alfalab/core-components-shared/modern';
|
|
7
|
+
import { getDataTestId, fnUtils } from '@alfalab/core-components-shared/modern';
|
|
8
8
|
import { Footer } from './components/footer/Component.js';
|
|
9
9
|
import { Header } from './components/header/Component.js';
|
|
10
10
|
import { SwipeableBackdrop } from './components/swipeable-backdrop/Component.js';
|
|
@@ -12,11 +12,11 @@ import { convertPercentToNumber, TIMEOUT, MARKER_HEIGHT, SCROLL_OFFSET, SWIPE_VE
|
|
|
12
12
|
import '@alfalab/core-components-navigation-bar/modern';
|
|
13
13
|
import '@alfalab/core-components-backdrop/modern';
|
|
14
14
|
|
|
15
|
-
const styles = {"modal":"bottom-
|
|
15
|
+
const styles = {"modal":"bottom-sheet__modal_88g3f","wrapper":"bottom-sheet__wrapper_88g3f","fullscreen":"bottom-sheet__fullscreen_88g3f","component":"bottom-sheet__component_88g3f","withTransition":"bottom-sheet__withTransition_88g3f","scrollableContainer":"bottom-sheet__scrollableContainer_88g3f","marker":"bottom-sheet__marker_88g3f","defaultMarker":"bottom-sheet__defaultMarker_88g3f","content":"bottom-sheet__content_88g3f","noHeader":"bottom-sheet__noHeader_88g3f","noFooter":"bottom-sheet__noFooter_88g3f","scrollLocked":"bottom-sheet__scrollLocked_88g3f","hiddenScrollbar":"bottom-sheet__hiddenScrollbar_88g3f","disabledPointerEvents":"bottom-sheet__disabledPointerEvents_88g3f","appear":"bottom-sheet__appear_88g3f","enter":"bottom-sheet__enter_88g3f","appearActive":"bottom-sheet__appearActive_88g3f","enterActive":"bottom-sheet__enterActive_88g3f","enterDone":"bottom-sheet__enterDone_88g3f","appearDone":"bottom-sheet__appearDone_88g3f","exit":"bottom-sheet__exit_88g3f","exitActive":"bottom-sheet__exitActive_88g3f","background-accent":"bottom-sheet__background-accent_88g3f","background-info":"bottom-sheet__background-info_88g3f","background-attention-muted":"bottom-sheet__background-attention-muted_88g3f","background-positive-muted":"bottom-sheet__background-positive-muted_88g3f","background-negative-muted":"bottom-sheet__background-negative-muted_88g3f","background-primary":"bottom-sheet__background-primary_88g3f","background-primary-inverted":"bottom-sheet__background-primary-inverted_88g3f","background-secondary":"bottom-sheet__background-secondary_88g3f","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_88g3f","background-tertiary":"bottom-sheet__background-tertiary_88g3f","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_88g3f","background-quaternary":"bottom-sheet__background-quaternary_88g3f","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_88g3f","background-specialbg-component":"bottom-sheet__background-specialbg-component_88g3f","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_88g3f","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_88g3f","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_88g3f","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_88g3f","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_88g3f","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_88g3f","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_88g3f","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_88g3f"};
|
|
16
16
|
require('./index.css')
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
|
|
18
|
+
const { isNil } = fnUtils;
|
|
19
|
+
const BottomSheet = forwardRef(({ open, title, container, usePortal, backgroundColor, titleSize = 'default', subtitle, 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, hideScrollbar, hideHeader, disableOverlayClick, disableBlockingScroll, disableFocusLock, children, zIndex, transitionProps = {}, magneticAreas: magneticAreasProp, initialActiveAreaIndex, dataTestId, swipeable = true, swipeableContent = true, swipeThreshold = 5, scrollLocked: scrollLockedProp, backdropProps, scrollableContainerRef = () => null, bottomSheetInstanceRef, sheetContainerRef = () => null, headerOffset = 24, onClose, onBack, onMagnetize, onTouchEnd, disableRestoreFocus, disableAutoFocus, disableEscapeKeyDown, keepMounted, onMagnetizeEnd, onOffsetChange, swipeableMarker, swipeableMarkerClassName, }, ref) => {
|
|
20
20
|
const fullHeight = use100vh() || 0;
|
|
21
21
|
// Хук use100vh рассчитывает высоту вьюпорта в useEffect, поэтому на первый рендер всегда возвращает null.
|
|
22
22
|
const isFirstRender = fullHeight === 0;
|
|
@@ -214,7 +214,8 @@ const BottomSheet = forwardRef(({ open, title, container, usePortal, backgroundC
|
|
|
214
214
|
}
|
|
215
215
|
setSwipingInProgress(true);
|
|
216
216
|
};
|
|
217
|
-
const handleTouchEnd = () => {
|
|
217
|
+
const handleTouchEnd = ({ event }) => {
|
|
218
|
+
onTouchEnd?.(event);
|
|
218
219
|
setSwipingInProgress(false);
|
|
219
220
|
scrollOccurred.current = false;
|
|
220
221
|
};
|
|
@@ -240,9 +241,9 @@ const BottomSheet = forwardRef(({ open, title, container, usePortal, backgroundC
|
|
|
240
241
|
});
|
|
241
242
|
const handleExited = (node) => {
|
|
242
243
|
const idx = initialActiveAreaIndex;
|
|
243
|
-
const nextArea =
|
|
244
|
+
const nextArea = isNil(idx) ? lastMagneticArea : magneticAreas[idx];
|
|
244
245
|
setBackdropOpacity(1);
|
|
245
|
-
setSheetOffset(
|
|
246
|
+
setSheetOffset(isNil(idx) ? magneticAreas[0] : lastMagneticArea - magneticAreas[idx]);
|
|
246
247
|
setActiveArea(nextArea);
|
|
247
248
|
onMagnetizeEnd?.();
|
|
248
249
|
if (transitionProps.onExited) {
|
|
@@ -272,13 +273,13 @@ const BottomSheet = forwardRef(({ open, title, container, usePortal, backgroundC
|
|
|
272
273
|
}
|
|
273
274
|
};
|
|
274
275
|
useEffect(() => {
|
|
275
|
-
// Инициализируем стейт только после того, как была рассчитана высота
|
|
276
|
+
// Инициализируем стейт только после того, как была рассчитана высота вьюпорта
|
|
276
277
|
if (!isFirstRender) {
|
|
277
|
-
|
|
278
|
-
|
|
278
|
+
const idx = initialActiveAreaIndex;
|
|
279
|
+
setSheetOffset(isNil(idx) ? 0 : lastMagneticArea - magneticAreas[idx]);
|
|
280
|
+
setActiveArea(isNil(idx) ? lastMagneticArea : magneticAreas[idx]);
|
|
279
281
|
}
|
|
280
|
-
|
|
281
|
-
}, [isFirstRender]);
|
|
282
|
+
}, [initialActiveAreaIndex, isFirstRender, lastMagneticArea, magneticAreas]);
|
|
282
283
|
useEffect(() => {
|
|
283
284
|
if (!sheetRef.current)
|
|
284
285
|
return;
|
|
@@ -2,7 +2,7 @@ import React, { useContext, useEffect } from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { BaseModalContext } from '@alfalab/core-components-base-modal/modern';
|
|
4
4
|
|
|
5
|
-
const styles = {"footer":"bottom-
|
|
5
|
+
const styles = {"footer":"bottom-sheet__footer_139bm","sticky":"bottom-sheet__sticky_139bm","highlighted":"bottom-sheet__highlighted_139bm","background-accent":"bottom-sheet__background-accent_139bm","background-info":"bottom-sheet__background-info_139bm","background-attention-muted":"bottom-sheet__background-attention-muted_139bm","background-positive-muted":"bottom-sheet__background-positive-muted_139bm","background-negative-muted":"bottom-sheet__background-negative-muted_139bm","background-primary":"bottom-sheet__background-primary_139bm","background-primary-inverted":"bottom-sheet__background-primary-inverted_139bm","background-secondary":"bottom-sheet__background-secondary_139bm","background-secondary-inverted":"bottom-sheet__background-secondary-inverted_139bm","background-tertiary":"bottom-sheet__background-tertiary_139bm","background-tertiary-inverted":"bottom-sheet__background-tertiary-inverted_139bm","background-quaternary":"bottom-sheet__background-quaternary_139bm","background-quaternary-inverted":"bottom-sheet__background-quaternary-inverted_139bm","background-specialbg-component":"bottom-sheet__background-specialbg-component_139bm","background-specialbg-component-inverted":"bottom-sheet__background-specialbg-component-inverted_139bm","background-specialbg-primary-grouped":"bottom-sheet__background-specialbg-primary-grouped_139bm","background-specialbg-secondary-grouped":"bottom-sheet__background-specialbg-secondary-grouped_139bm","background-specialbg-tertiary-grouped":"bottom-sheet__background-specialbg-tertiary-grouped_139bm","background-specialbg-secondary-transparent":"bottom-sheet__background-specialbg-secondary-transparent_139bm","background-specialbg-secondary-transparent-inverted":"bottom-sheet__background-specialbg-secondary-transparent-inverted_139bm","background-specialbg-tertiary-transparent":"bottom-sheet__background-specialbg-tertiary-transparent_139bm","background-specialbg-tertiary-transparent-inverted":"bottom-sheet__background-specialbg-tertiary-transparent-inverted_139bm"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
const Footer = ({ children, className, sticky }) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: v9a86 */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-accent: #ef3124;
|
|
@@ -41,58 +41,58 @@
|
|
|
41
41
|
} :root {
|
|
42
42
|
--bottom-sheet-footer-border-top: 1px solid var(--color-light-border-secondary);
|
|
43
43
|
--bottom-sheet-footer-background-color: var(--color-light-bg-primary);
|
|
44
|
-
} .bottom-
|
|
44
|
+
} .bottom-sheet__footer_139bm {
|
|
45
45
|
padding: var(--gap-m) var(--gap-m);
|
|
46
46
|
background-color: var(--color-light-bg-primary);
|
|
47
|
-
} .bottom-
|
|
47
|
+
} .bottom-sheet__sticky_139bm {
|
|
48
48
|
position: sticky;
|
|
49
49
|
bottom: 0;
|
|
50
50
|
z-index: 1;
|
|
51
|
-
} .bottom-
|
|
51
|
+
} .bottom-sheet__highlighted_139bm {
|
|
52
52
|
border-top: var(--bottom-sheet-footer-border-top);
|
|
53
53
|
background-color: var(--bottom-sheet-footer-background-color);
|
|
54
|
-
} .bottom-sheet__background-
|
|
54
|
+
} .bottom-sheet__background-accent_139bm {
|
|
55
55
|
background-color: var(--color-light-bg-accent);
|
|
56
|
-
} .bottom-sheet__background-
|
|
56
|
+
} .bottom-sheet__background-info_139bm {
|
|
57
57
|
background-color: var(--color-light-bg-info);
|
|
58
|
-
} .bottom-sheet__background-attention-
|
|
58
|
+
} .bottom-sheet__background-attention-muted_139bm {
|
|
59
59
|
background-color: var(--color-light-bg-attention-muted);
|
|
60
|
-
} .bottom-sheet__background-positive-
|
|
60
|
+
} .bottom-sheet__background-positive-muted_139bm {
|
|
61
61
|
background-color: var(--color-light-bg-positive-muted);
|
|
62
|
-
} .bottom-sheet__background-negative-
|
|
62
|
+
} .bottom-sheet__background-negative-muted_139bm {
|
|
63
63
|
background-color: var(--color-light-bg-negative-muted);
|
|
64
|
-
} .bottom-sheet__background-
|
|
64
|
+
} .bottom-sheet__background-primary_139bm {
|
|
65
65
|
background-color: var(--color-light-bg-primary);
|
|
66
|
-
} .bottom-sheet__background-primary-
|
|
66
|
+
} .bottom-sheet__background-primary-inverted_139bm {
|
|
67
67
|
background-color: var(--color-light-bg-primary-inverted);
|
|
68
|
-
} .bottom-sheet__background-
|
|
68
|
+
} .bottom-sheet__background-secondary_139bm {
|
|
69
69
|
background-color: var(--color-light-bg-secondary);
|
|
70
|
-
} .bottom-sheet__background-secondary-
|
|
70
|
+
} .bottom-sheet__background-secondary-inverted_139bm {
|
|
71
71
|
background-color: var(--color-light-bg-secondary-inverted);
|
|
72
|
-
} .bottom-sheet__background-
|
|
72
|
+
} .bottom-sheet__background-tertiary_139bm {
|
|
73
73
|
background-color: var(--color-light-bg-tertiary);
|
|
74
|
-
} .bottom-sheet__background-tertiary-
|
|
74
|
+
} .bottom-sheet__background-tertiary-inverted_139bm {
|
|
75
75
|
background-color: var(--color-light-bg-tertiary-inverted);
|
|
76
|
-
} .bottom-sheet__background-
|
|
76
|
+
} .bottom-sheet__background-quaternary_139bm {
|
|
77
77
|
background-color: var(--color-light-bg-quaternary);
|
|
78
|
-
} .bottom-sheet__background-quaternary-
|
|
78
|
+
} .bottom-sheet__background-quaternary-inverted_139bm {
|
|
79
79
|
background-color: var(--color-light-bg-quaternary-inverted);
|
|
80
|
-
} .bottom-sheet__background-specialbg-
|
|
80
|
+
} .bottom-sheet__background-specialbg-component_139bm {
|
|
81
81
|
background-color: var(--color-light-specialbg-component);
|
|
82
|
-
} .bottom-sheet__background-specialbg-component-
|
|
82
|
+
} .bottom-sheet__background-specialbg-component-inverted_139bm {
|
|
83
83
|
background-color: var(--color-light-specialbg-component-inverted);
|
|
84
|
-
} .bottom-sheet__background-specialbg-primary-
|
|
84
|
+
} .bottom-sheet__background-specialbg-primary-grouped_139bm {
|
|
85
85
|
background-color: var(--color-light-specialbg-primary-grouped);
|
|
86
|
-
} .bottom-sheet__background-specialbg-secondary-
|
|
86
|
+
} .bottom-sheet__background-specialbg-secondary-grouped_139bm {
|
|
87
87
|
background-color: var(--color-light-specialbg-secondary-grouped);
|
|
88
|
-
} .bottom-sheet__background-specialbg-tertiary-
|
|
88
|
+
} .bottom-sheet__background-specialbg-tertiary-grouped_139bm {
|
|
89
89
|
background-color: var(--color-light-specialbg-tertiary-grouped);
|
|
90
|
-
} .bottom-sheet__background-specialbg-secondary-
|
|
90
|
+
} .bottom-sheet__background-specialbg-secondary-transparent_139bm {
|
|
91
91
|
background-color: var(--color-light-specialbg-secondary-transparent);
|
|
92
|
-
} .bottom-sheet__background-specialbg-secondary-transparent-
|
|
92
|
+
} .bottom-sheet__background-specialbg-secondary-transparent-inverted_139bm {
|
|
93
93
|
background-color: var(--color-light-specialbg-secondary-transparent-inverted);
|
|
94
|
-
} .bottom-sheet__background-specialbg-tertiary-
|
|
94
|
+
} .bottom-sheet__background-specialbg-tertiary-transparent_139bm {
|
|
95
95
|
background-color: var(--color-light-specialbg-tertiary-transparent);
|
|
96
|
-
} .bottom-sheet__background-specialbg-tertiary-transparent-
|
|
96
|
+
} .bottom-sheet__background-specialbg-tertiary-transparent-inverted_139bm {
|
|
97
97
|
background-color: var(--color-light-specialbg-tertiary-transparent-inverted);
|
|
98
98
|
}
|
|
@@ -3,7 +3,7 @@ import cn from 'classnames';
|
|
|
3
3
|
import { BaseModalContext } from '@alfalab/core-components-base-modal/modern';
|
|
4
4
|
import { NavigationBar } from '@alfalab/core-components-navigation-bar/modern';
|
|
5
5
|
|
|
6
|
-
const styles = {"headerWrapper":"bottom-
|
|
6
|
+
const styles = {"headerWrapper":"bottom-sheet__headerWrapper_198ve","hasContent":"bottom-sheet__hasContent_198ve","header":"bottom-sheet__header_198ve","sticky":"bottom-sheet__sticky_198ve","highlighted":"bottom-sheet__highlighted_198ve","justifyEnd":"bottom-sheet__justifyEnd_198ve","addon":"bottom-sheet__addon_198ve","addonFixed":"bottom-sheet__addonFixed_198ve","title":"bottom-sheet__title_198ve","titleCenter":"bottom-sheet__titleCenter_198ve","titleLeft":"bottom-sheet__titleLeft_198ve","trimTitle":"bottom-sheet__trimTitle_198ve"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
9
|
const Header = ({ className, sticky, headerRef, headerOffset, title, children, ...restProps }) => {
|