@alfalab/core-components-bottom-sheet 4.0.0 → 4.1.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/CHANGELOG.md +20 -0
- package/dist/{component-0665a3d7.d.ts → component-8680d27f.d.ts} +9 -6
- package/dist/{component-0665a3d7.js → component-8680d27f.js} +15 -15
- package/dist/component.js +2 -2
- package/dist/components/backer/Component.js +2 -2
- package/dist/components/backer/index.css +9 -4
- package/dist/components/closer/Component.js +2 -2
- package/dist/components/closer/index.css +9 -4
- package/dist/components/footer/Component.js +1 -1
- package/dist/components/footer/index.css +4 -4
- package/dist/components/header/Component.js +2 -2
- package/dist/components/header/index.css +17 -30
- package/dist/components/swipeable-backdrop/Component.js +1 -1
- package/dist/{esm/component-2501d7d0.d.ts → cssm/component-d1b19e73.d.ts} +9 -6
- package/dist/cssm/{component-4b59a168.js → component-d1b19e73.js} +12 -12
- package/dist/cssm/component.js +1 -1
- package/dist/cssm/components/backer/index.module.css +6 -1
- package/dist/cssm/components/closer/index.module.css +6 -1
- package/dist/cssm/components/header/Component.js +1 -1
- package/dist/cssm/components/header/index.module.css +1 -14
- package/dist/cssm/index.d.ts +1 -1
- package/dist/cssm/index.js +1 -1
- package/dist/cssm/index.module.css +1 -1
- package/dist/{cssm/component-4b59a168.d.ts → esm/component-7d960f38.d.ts} +9 -6
- package/dist/esm/{component-2501d7d0.js → component-7d960f38.js} +15 -15
- package/dist/esm/component.js +2 -2
- package/dist/esm/components/backer/Component.js +2 -2
- package/dist/esm/components/backer/index.css +9 -4
- package/dist/esm/components/closer/Component.js +2 -2
- package/dist/esm/components/closer/index.css +9 -4
- package/dist/esm/components/footer/Component.js +1 -1
- package/dist/esm/components/footer/index.css +4 -4
- package/dist/esm/components/header/Component.js +2 -2
- package/dist/esm/components/header/index.css +17 -30
- package/dist/esm/components/swipeable-backdrop/Component.js +1 -1
- package/dist/esm/index.css +16 -16
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/{tslib.es6-97cd96ee.d.ts → tslib.es6-7f629856.d.ts} +0 -0
- package/dist/esm/{tslib.es6-97cd96ee.js → tslib.es6-7f629856.js} +0 -0
- package/dist/index.css +16 -16
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/modern/{component-6718dad9.d.ts → component-7a1c353b.d.ts} +9 -6
- package/dist/modern/{component-6718dad9.js → component-7a1c353b.js} +12 -12
- package/dist/modern/component.js +1 -1
- package/dist/modern/components/backer/Component.js +1 -1
- package/dist/modern/components/backer/index.css +9 -4
- package/dist/modern/components/closer/Component.js +1 -1
- package/dist/modern/components/closer/index.css +9 -4
- package/dist/modern/components/footer/Component.js +1 -1
- package/dist/modern/components/footer/index.css +4 -4
- package/dist/modern/components/header/Component.js +1 -1
- package/dist/modern/components/header/index.css +17 -30
- package/dist/modern/index.css +16 -16
- package/dist/modern/index.d.ts +1 -1
- package/dist/modern/index.js +1 -1
- package/dist/{tslib.es6-4d9b8d1d.d.ts → tslib.es6-c74c8bbc.d.ts} +0 -0
- package/dist/{tslib.es6-4d9b8d1d.js → tslib.es6-c74c8bbc.js} +0 -0
- package/package.json +10 -10
package/dist/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 6bbw4 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
--color-light-graphic-neutral: #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_1nq3o {
|
|
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_1nq3o {
|
|
35
35
|
overflow: hidden;
|
|
36
36
|
position: relative;
|
|
37
37
|
display: flex;
|
|
@@ -41,18 +41,18 @@
|
|
|
41
41
|
background: var(--color-light-bg-primary);
|
|
42
42
|
transform: translateY(100%);
|
|
43
43
|
}
|
|
44
|
-
.bottom-
|
|
44
|
+
.bottom-sheet__withTransition_1nq3o {
|
|
45
45
|
transition: var(--bottom-sheet-out-transition);
|
|
46
46
|
}
|
|
47
|
-
.bottom-
|
|
47
|
+
.bottom-sheet__scrollableContainer_1nq3o {
|
|
48
48
|
overflow: auto;
|
|
49
49
|
display: flex;
|
|
50
50
|
flex-direction: column;
|
|
51
51
|
position: relative;
|
|
52
52
|
height: 100%;
|
|
53
53
|
}
|
|
54
|
-
.bottom-
|
|
55
|
-
position:
|
|
54
|
+
.bottom-sheet__marker_1nq3o {
|
|
55
|
+
position: fixed;
|
|
56
56
|
top: var(--gap-2xs);
|
|
57
57
|
left: 50%;
|
|
58
58
|
width: 36px;
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
background-color: var(--color-light-graphic-neutral);
|
|
63
63
|
z-index: 1000;
|
|
64
64
|
}
|
|
65
|
-
.bottom-
|
|
65
|
+
.bottom-sheet__content_1nq3o {
|
|
66
66
|
display: flex;
|
|
67
67
|
flex-direction: column;
|
|
68
68
|
flex: 1;
|
|
@@ -70,29 +70,29 @@
|
|
|
70
70
|
color: var(--color-light-text-primary);
|
|
71
71
|
background-color: var(--color-light-bg-primary);
|
|
72
72
|
}
|
|
73
|
-
.bottom-
|
|
73
|
+
.bottom-sheet__noHeader_1nq3o {
|
|
74
74
|
padding-top: var(--gap-xl);
|
|
75
75
|
}
|
|
76
|
-
.bottom-
|
|
76
|
+
.bottom-sheet__noFooter_1nq3o {
|
|
77
77
|
padding-bottom: var(--gap-m);
|
|
78
78
|
}
|
|
79
|
-
.bottom-
|
|
79
|
+
.bottom-sheet__scrollLocked_1nq3o {
|
|
80
80
|
overflow: hidden;
|
|
81
81
|
}
|
|
82
|
-
.bottom-
|
|
82
|
+
.bottom-sheet__appear_1nq3o .bottom-sheet__component_1nq3o, .bottom-sheet__enter_1nq3o .bottom-sheet__component_1nq3o {
|
|
83
83
|
transition: none;
|
|
84
84
|
}
|
|
85
|
-
.bottom-
|
|
85
|
+
.bottom-sheet__appearActive_1nq3o .bottom-sheet__component_1nq3o, .bottom-sheet__enterActive_1nq3o .bottom-sheet__component_1nq3o {
|
|
86
86
|
transition: var(--bottom-sheet-in-transition);
|
|
87
87
|
transform: translateY(0);
|
|
88
88
|
}
|
|
89
|
-
.bottom-
|
|
89
|
+
.bottom-sheet__enterDone_1nq3o .bottom-sheet__component_1nq3o, .bottom-sheet__appearDone_1nq3o .bottom-sheet__component_1nq3o {
|
|
90
90
|
transform: translateY(0);
|
|
91
91
|
}
|
|
92
|
-
.bottom-
|
|
92
|
+
.bottom-sheet__exit_1nq3o .bottom-sheet__component_1nq3o {
|
|
93
93
|
transform: translateY(0);
|
|
94
94
|
}
|
|
95
|
-
.bottom-
|
|
95
|
+
.bottom-sheet__exitActive_1nq3o .bottom-sheet__component_1nq3o {
|
|
96
96
|
transition: var(--bottom-sheet-out-transition);
|
|
97
97
|
transform: translateY(100%);
|
|
98
98
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./component-
|
|
1
|
+
export * from "./component-8680d27f";
|
package/dist/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-c74c8bbc.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-8680d27f.js');
|
|
18
18
|
require('./components/footer/Component.js');
|
|
19
19
|
require('@alfalab/core-components-backdrop');
|
|
20
20
|
require('./components/swipeable-backdrop/Component.js');
|
|
@@ -12,7 +12,7 @@ type HeaderProps = {
|
|
|
12
12
|
/**
|
|
13
13
|
* Дополнительный класс
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
headerClassName?: string;
|
|
16
16
|
/**
|
|
17
17
|
* Дополнительный класс для аддонов
|
|
18
18
|
*/
|
|
@@ -25,11 +25,6 @@ type HeaderProps = {
|
|
|
25
25
|
* Дополнительный класс для компонента стрелки назад
|
|
26
26
|
*/
|
|
27
27
|
backerClassName?: string;
|
|
28
|
-
/**
|
|
29
|
-
* Будет ли свайпаться шторка
|
|
30
|
-
* @default true
|
|
31
|
-
*/
|
|
32
|
-
swipeable?: boolean;
|
|
33
28
|
/**
|
|
34
29
|
* Слот слева
|
|
35
30
|
*/
|
|
@@ -90,10 +85,18 @@ type BottomSheetProps = {
|
|
|
90
85
|
* Дополнительный класс
|
|
91
86
|
*/
|
|
92
87
|
contentClassName?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Дополнительный класс
|
|
90
|
+
*/
|
|
91
|
+
containerClassName?: string;
|
|
93
92
|
/**
|
|
94
93
|
* Дополнительный класс шапки
|
|
95
94
|
*/
|
|
96
95
|
headerClassName?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Дополнительный класс футера
|
|
98
|
+
*/
|
|
99
|
+
footerClassName?: string;
|
|
97
100
|
/**
|
|
98
101
|
* Дополнительный класс для аддонов
|
|
99
102
|
*/
|
|
@@ -9,10 +9,10 @@ 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
|
-
var styles = {"header":"bottom-
|
|
12
|
+
var styles = {"header":"bottom-sheet__header_1ezhe","sticky":"bottom-sheet__sticky_1ezhe","highlighted":"bottom-sheet__highlighted_1ezhe","justifyEnd":"bottom-sheet__justifyEnd_1ezhe","addon":"bottom-sheet__addon_1ezhe","addonFixed":"bottom-sheet__addonFixed_1ezhe","addonLeft":"bottom-sheet__addonLeft_1ezhe","addonRight":"bottom-sheet__addonRight_1ezhe","title":"bottom-sheet__title_1ezhe","titleCenter":"bottom-sheet__titleCenter_1ezhe","titleLeft":"bottom-sheet__titleLeft_1ezhe","trimTitle":"bottom-sheet__trimTitle_1ezhe","titleBigIndentHorizontal":"bottom-sheet__titleBigIndentHorizontal_1ezhe","titleIndentRight":"bottom-sheet__titleIndentRight_1ezhe","titleIndentLeft":"bottom-sheet__titleIndentLeft_1ezhe"};
|
|
13
13
|
require('./components/header/index.css')
|
|
14
14
|
|
|
15
|
-
const Header = ({ title,
|
|
15
|
+
const Header = ({ title, headerClassName, addonClassName, closerClassName, backerClassName, leftAddons, rightAddons, hasCloser, hasBacker, titleAlign, trimTitle, sticky, onBack, }) => {
|
|
16
16
|
const { headerHighlighted, setHasHeader, setHeaderOffset } = useContext(BaseModalContext);
|
|
17
17
|
const hasLeftPart = hasBacker || leftAddons || titleAlign === 'center';
|
|
18
18
|
const hasRightPart = hasCloser || rightAddons || titleAlign === 'center';
|
|
@@ -33,12 +33,11 @@ const Header = ({ title, className, addonClassName, closerClassName, backerClass
|
|
|
33
33
|
[styles.titleIndentRight]: !sticky && !titleAlignedCenter && hasRightPart,
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
return (React.createElement("div", { className: cn(styles.header,
|
|
36
|
+
return (React.createElement("div", { className: cn(styles.header, headerClassName, {
|
|
37
37
|
[styles.justifyEnd]: !title,
|
|
38
38
|
[styles.highlighted]: headerHighlighted && sticky,
|
|
39
39
|
[styles.sticky]: sticky,
|
|
40
40
|
}) },
|
|
41
|
-
swipeable && React.createElement("div", { className: cn(styles.marker) }),
|
|
42
41
|
hasLeftPart && (React.createElement("div", { className: cn(styles.addon, addonClassName, {
|
|
43
42
|
[styles.addonFixed]: !sticky,
|
|
44
43
|
[styles.addonLeft]: !sticky,
|
|
@@ -54,17 +53,18 @@ const Header = ({ title, className, addonClassName, closerClassName, backerClass
|
|
|
54
53
|
}) }, hasCloser ? React.createElement(Closer, { className: closerClassName }) : rightAddons))));
|
|
55
54
|
};
|
|
56
55
|
|
|
57
|
-
var styles$1 = {"modal":"bottom-
|
|
56
|
+
var styles$1 = {"modal":"bottom-sheet__modal_1nq3o","component":"bottom-sheet__component_1nq3o","withTransition":"bottom-sheet__withTransition_1nq3o","scrollableContainer":"bottom-sheet__scrollableContainer_1nq3o","marker":"bottom-sheet__marker_1nq3o","content":"bottom-sheet__content_1nq3o","noHeader":"bottom-sheet__noHeader_1nq3o","noFooter":"bottom-sheet__noFooter_1nq3o","scrollLocked":"bottom-sheet__scrollLocked_1nq3o","appear":"bottom-sheet__appear_1nq3o","enter":"bottom-sheet__enter_1nq3o","appearActive":"bottom-sheet__appearActive_1nq3o","enterActive":"bottom-sheet__enterActive_1nq3o","enterDone":"bottom-sheet__enterDone_1nq3o","appearDone":"bottom-sheet__appearDone_1nq3o","exit":"bottom-sheet__exit_1nq3o","exitActive":"bottom-sheet__exitActive_1nq3o"};
|
|
58
57
|
require('./index.css')
|
|
59
58
|
|
|
60
59
|
const TIMEOUT = 300;
|
|
61
60
|
const SWIPE_CLOSE_VELOCITY = 0.4;
|
|
62
61
|
const MIN_BACKDROP_OPACITY = 0.2;
|
|
63
62
|
const HEADER_HEIGHT = 56;
|
|
63
|
+
const MARKET_HEIGHT = 24;
|
|
64
64
|
/* Верхний отступ шторки, если она открыта на максимальную высоту */
|
|
65
65
|
const HEADER_OFFSET = 24;
|
|
66
66
|
const CLOSE_OFFSET = 0.2;
|
|
67
|
-
const BottomSheet = forwardRef(({ open, title, actionButton, contentClassName, headerClassName, addonClassName, closerClassName, backerClassName, className, leftAddons, rightAddons, hasCloser, hasBacker, titleAlign = 'left', trimTitle, stickyHeader, stickyFooter, initialHeight = 'default', hideOverlay, hideHeader, disableOverlayClick, children, zIndex, transitionProps = {}, dataTestId, swipeable = true, onClose, onBack, }, ref) => {
|
|
67
|
+
const BottomSheet = forwardRef(({ open, title, actionButton, contentClassName, containerClassName, headerClassName, footerClassName, addonClassName, closerClassName, backerClassName, className, leftAddons, rightAddons, hasCloser, hasBacker, titleAlign = 'left', trimTitle, stickyHeader, stickyFooter = true, initialHeight = 'default', hideOverlay, hideHeader, disableOverlayClick, children, zIndex, transitionProps = {}, dataTestId, swipeable = true, onClose, onBack, }, ref) => {
|
|
68
68
|
const [sheetOffset, setSheetOffset] = useState(0);
|
|
69
69
|
const [backdropOpacity, setBackdropOpacity] = useState(1);
|
|
70
70
|
const [scrollLocked, setScrollLocked] = useState(false);
|
|
@@ -81,7 +81,6 @@ const BottomSheet = forwardRef(({ open, title, actionButton, contentClassName, h
|
|
|
81
81
|
addonClassName,
|
|
82
82
|
closerClassName,
|
|
83
83
|
backerClassName,
|
|
84
|
-
swipeable,
|
|
85
84
|
leftAddons,
|
|
86
85
|
rightAddons,
|
|
87
86
|
hasCloser,
|
|
@@ -110,7 +109,8 @@ const BottomSheet = forwardRef(({ open, title, actionButton, contentClassName, h
|
|
|
110
109
|
if (!swipeable)
|
|
111
110
|
return true;
|
|
112
111
|
if (!scrollableContainer.current ||
|
|
113
|
-
(stickyHeader && offsetY <= HEADER_HEIGHT + HEADER_OFFSET)
|
|
112
|
+
(stickyHeader && offsetY <= HEADER_HEIGHT + HEADER_OFFSET) ||
|
|
113
|
+
(!stickyHeader && offsetY <= MARKET_HEIGHT + HEADER_OFFSET)) {
|
|
114
114
|
return false;
|
|
115
115
|
}
|
|
116
116
|
if (!scrollableContainerScrollValue.current) {
|
|
@@ -169,7 +169,7 @@ const BottomSheet = forwardRef(({ open, title, actionButton, contentClassName, h
|
|
|
169
169
|
delta: 5,
|
|
170
170
|
trackMouse: swipeable,
|
|
171
171
|
});
|
|
172
|
-
const handleExited = useCallback(
|
|
172
|
+
const handleExited = useCallback(node => {
|
|
173
173
|
setBackdropOpacity(1);
|
|
174
174
|
if (transitionProps.onExited) {
|
|
175
175
|
transitionProps.onExited(node);
|
|
@@ -215,16 +215,16 @@ const BottomSheet = forwardRef(({ open, title, actionButton, contentClassName, h
|
|
|
215
215
|
...getSwipeStyles(),
|
|
216
216
|
...getHeightStyles(),
|
|
217
217
|
} }, sheetSwipeablehandlers),
|
|
218
|
-
React.createElement("div", { className: cn(styles$1.scrollableContainer, {
|
|
218
|
+
React.createElement("div", { className: cn(styles$1.scrollableContainer, containerClassName, {
|
|
219
219
|
[styles$1.scrollLocked]: scrollLocked,
|
|
220
220
|
}), ref: scrollableContainer },
|
|
221
|
-
swipeable &&
|
|
221
|
+
swipeable && React.createElement("div", { className: cn(styles$1.marker) }),
|
|
222
222
|
!hideHeader && !emptyHeader && React.createElement(Header, Object.assign({}, headerProps)),
|
|
223
223
|
React.createElement("div", { className: cn(styles$1.content, contentClassName, {
|
|
224
224
|
[styles$1.noHeader]: hideHeader || emptyHeader,
|
|
225
225
|
[styles$1.noFooter]: !actionButton,
|
|
226
226
|
}) }, children),
|
|
227
|
-
actionButton && React.createElement(Footer, { sticky: stickyFooter }, actionButton)))));
|
|
227
|
+
actionButton && (React.createElement(Footer, { sticky: stickyFooter, className: footerClassName }, actionButton))))));
|
|
228
228
|
});
|
|
229
229
|
|
|
230
230
|
export { BottomSheet as B, CLOSE_OFFSET as C, HEADER_OFFSET as H, Header as a };
|
package/dist/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-7a1c353b.js';
|
|
13
13
|
import './components/footer/Component.js';
|
|
14
14
|
import '@alfalab/core-components-backdrop/dist/modern';
|
|
15
15
|
import './components/swipeable-backdrop/Component.js';
|
|
@@ -3,7 +3,7 @@ import cn from 'classnames';
|
|
|
3
3
|
import { IconButton } from '@alfalab/core-components-icon-button/dist/modern';
|
|
4
4
|
import { ArrowBackMIcon } from '@alfalab/icons-glyph/ArrowBackMIcon';
|
|
5
5
|
|
|
6
|
-
var styles = {"backer":"bottom-
|
|
6
|
+
var styles = {"backer":"bottom-sheet__backer_kyu8g","button":"bottom-sheet__button_kyu8g"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
9
|
const Backer = ({ className, size = 'xs', icon = ArrowBackMIcon, onClick, ...restProps }) => {
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
/* hash:
|
|
2
|
-
|
|
1
|
+
/* hash: 11qdr */
|
|
2
|
+
:root {
|
|
3
|
+
--bottom-sheet-backer-bg-color: var(--color-light-bg-primary-inverted-alpha-3);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.bottom-sheet__backer_kyu8g {
|
|
3
7
|
width: 32px;
|
|
4
8
|
height: 32px;
|
|
5
9
|
display: flex;
|
|
6
10
|
justify-content: center;
|
|
7
11
|
align-items: center;
|
|
8
12
|
cursor: pointer;
|
|
13
|
+
color: var(--color-light-graphic-primary);
|
|
9
14
|
}
|
|
10
15
|
|
|
11
|
-
.bottom-
|
|
12
|
-
background:
|
|
16
|
+
.bottom-sheet__button_kyu8g {
|
|
17
|
+
background: var(--bottom-sheet-backer-bg-color);
|
|
13
18
|
-webkit-backdrop-filter: blur(10px);
|
|
14
19
|
backdrop-filter: blur(10px);
|
|
15
20
|
border-radius: 50px;
|
|
@@ -4,7 +4,7 @@ import { BaseModalContext } from '@alfalab/core-components-base-modal/dist/moder
|
|
|
4
4
|
import { IconButton } from '@alfalab/core-components-icon-button/dist/modern';
|
|
5
5
|
import { CrossMIcon } from '@alfalab/icons-glyph/CrossMIcon';
|
|
6
6
|
|
|
7
|
-
var styles = {"closer":"bottom-
|
|
7
|
+
var styles = {"closer":"bottom-sheet__closer_2ue0t","button":"bottom-sheet__button_2ue0t"};
|
|
8
8
|
require('./index.css')
|
|
9
9
|
|
|
10
10
|
const Closer = ({ className, size = 'xs', icon = CrossMIcon, ...restProps }) => {
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
/* hash:
|
|
2
|
-
|
|
1
|
+
/* hash: 1lw2h */
|
|
2
|
+
:root {
|
|
3
|
+
--bottom-sheet-closer-bg-color: var(--color-light-bg-primary-inverted-alpha-3);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.bottom-sheet__closer_2ue0t {
|
|
3
7
|
width: 32px;
|
|
4
8
|
height: 32px;
|
|
5
9
|
display: flex;
|
|
6
10
|
justify-content: center;
|
|
7
11
|
align-items: center;
|
|
8
12
|
cursor: pointer;
|
|
13
|
+
color: var(--color-light-graphic-primary);
|
|
9
14
|
}
|
|
10
15
|
|
|
11
|
-
.bottom-
|
|
12
|
-
background:
|
|
16
|
+
.bottom-sheet__button_2ue0t {
|
|
17
|
+
background: var(--bottom-sheet-closer-bg-color);
|
|
13
18
|
-webkit-backdrop-filter: blur(10px);
|
|
14
19
|
backdrop-filter: blur(10px);
|
|
15
20
|
border-radius: 50px;
|
|
@@ -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/dist/modern';
|
|
4
4
|
|
|
5
|
-
var styles = {"footer":"bottom-
|
|
5
|
+
var styles = {"footer":"bottom-sheet__footer_1fb6t","sticky":"bottom-sheet__sticky_1fb6t","highlighted":"bottom-sheet__highlighted_1fb6t"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
const Footer = ({ children, className, sticky }) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 12ev6 */
|
|
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_1fb6t {
|
|
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_1fb6t {
|
|
26
26
|
position: sticky;
|
|
27
27
|
bottom: 0;
|
|
28
28
|
}
|
|
29
|
-
.bottom-
|
|
29
|
+
.bottom-sheet__highlighted_1fb6t {
|
|
30
30
|
border-top: var(--bottom-sheet-footer-border-top);
|
|
31
31
|
background-color: var(--bottom-sheet-footer-background-color);
|
|
32
32
|
}
|
|
@@ -9,7 +9,7 @@ import '@alfalab/icons-glyph/CrossMIcon';
|
|
|
9
9
|
import '../closer/Component.js';
|
|
10
10
|
import '@alfalab/icons-glyph/ArrowBackMIcon';
|
|
11
11
|
import '../backer/Component.js';
|
|
12
|
-
export { a as Header } from '../../component-
|
|
12
|
+
export { a as Header } from '../../component-7a1c353b.js';
|
|
13
13
|
import '../footer/Component.js';
|
|
14
14
|
import '@alfalab/core-components-backdrop/dist/modern';
|
|
15
15
|
import '../swipeable-backdrop/Component.js';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: c5fqk */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
|
-
--color-light-graphic-neutral: #dbdee1;
|
|
5
4
|
}
|
|
6
5
|
:root {
|
|
7
6
|
|
|
@@ -31,56 +30,44 @@
|
|
|
31
30
|
--bottom-sheet-title-font-family: var(--font-family-system);
|
|
32
31
|
--bottom-sheet-title-margin-vertical: var(--gap-2xs);
|
|
33
32
|
}
|
|
34
|
-
.bottom-
|
|
33
|
+
.bottom-sheet__header_1ezhe {
|
|
35
34
|
display: flex;
|
|
36
|
-
align-items: center;
|
|
37
35
|
padding: var(--gap-xs);
|
|
38
36
|
padding-bottom: 0;
|
|
39
37
|
background-color: var(--color-light-bg-primary);
|
|
40
38
|
border-top-right-radius: var(--border-radius-xl);
|
|
41
39
|
border-top-left-radius: var(--border-radius-xl);
|
|
40
|
+
z-index: 1;
|
|
42
41
|
}
|
|
43
|
-
.bottom-
|
|
42
|
+
.bottom-sheet__sticky_1ezhe {
|
|
44
43
|
position: sticky;
|
|
45
44
|
top: 0;
|
|
46
45
|
}
|
|
47
|
-
.bottom-
|
|
46
|
+
.bottom-sheet__highlighted_1ezhe {
|
|
48
47
|
border-bottom: var(--bottom-sheet-header-border-bottom);
|
|
49
48
|
}
|
|
50
|
-
.bottom-
|
|
49
|
+
.bottom-sheet__justifyEnd_1ezhe {
|
|
51
50
|
justify-content: flex-end;
|
|
52
51
|
}
|
|
53
|
-
.bottom-
|
|
54
|
-
position: absolute;
|
|
55
|
-
top: var(--gap-2xs);
|
|
56
|
-
left: 50%;
|
|
57
|
-
width: 36px;
|
|
58
|
-
height: 4px;
|
|
59
|
-
border-radius: 20px;
|
|
60
|
-
transform: translateX(-50%);
|
|
61
|
-
background-color: var(--color-light-graphic-neutral);
|
|
62
|
-
z-index: 1000;
|
|
63
|
-
}
|
|
64
|
-
.bottom-sheet__addon_6oyfh {
|
|
52
|
+
.bottom-sheet__addon_1ezhe {
|
|
65
53
|
display: flex;
|
|
66
54
|
justify-content: center;
|
|
67
55
|
align-items: center;
|
|
68
56
|
min-width: 48px;
|
|
69
57
|
height: 48px;
|
|
70
58
|
}
|
|
71
|
-
.bottom-
|
|
59
|
+
.bottom-sheet__addonFixed_1ezhe {
|
|
72
60
|
position: fixed;
|
|
73
61
|
}
|
|
74
|
-
.bottom-
|
|
62
|
+
.bottom-sheet__addonLeft_1ezhe {
|
|
75
63
|
left: 0;
|
|
76
64
|
margin-left: var(--gap-xs);
|
|
77
65
|
}
|
|
78
|
-
.bottom-
|
|
66
|
+
.bottom-sheet__addonRight_1ezhe {
|
|
79
67
|
right: 0;
|
|
80
68
|
margin-right: var(--gap-xs);
|
|
81
69
|
}
|
|
82
|
-
.bottom-
|
|
83
|
-
height: 24px;
|
|
70
|
+
.bottom-sheet__title_1ezhe {
|
|
84
71
|
padding: var(--gap-xs) var(--gap-xs);
|
|
85
72
|
margin: var(--bottom-sheet-title-margin-vertical) 0;
|
|
86
73
|
width: 100%;
|
|
@@ -89,23 +76,23 @@
|
|
|
89
76
|
line-height: var(--bottom-sheet-title-line-height);
|
|
90
77
|
font-family: var(--bottom-sheet-title-font-family);
|
|
91
78
|
}
|
|
92
|
-
.bottom-
|
|
79
|
+
.bottom-sheet__titleCenter_1ezhe {
|
|
93
80
|
text-align: center;
|
|
94
81
|
}
|
|
95
|
-
.bottom-
|
|
82
|
+
.bottom-sheet__titleLeft_1ezhe {
|
|
96
83
|
text-align: left;
|
|
97
84
|
}
|
|
98
|
-
.bottom-
|
|
85
|
+
.bottom-sheet__trimTitle_1ezhe {
|
|
99
86
|
white-space: nowrap;
|
|
100
87
|
overflow: hidden;
|
|
101
88
|
text-overflow: ellipsis;
|
|
102
89
|
}
|
|
103
|
-
.bottom-
|
|
90
|
+
.bottom-sheet__titleBigIndentHorizontal_1ezhe {
|
|
104
91
|
margin: var(--bottom-sheet-title-margin-vertical) var(--gap-4xl);
|
|
105
92
|
}
|
|
106
|
-
.bottom-
|
|
93
|
+
.bottom-sheet__titleIndentRight_1ezhe {
|
|
107
94
|
margin-right: var(--gap-4xl);
|
|
108
95
|
}
|
|
109
|
-
.bottom-
|
|
96
|
+
.bottom-sheet__titleIndentLeft_1ezhe {
|
|
110
97
|
margin-left: var(--gap-4xl);
|
|
111
98
|
}
|
package/dist/modern/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 6bbw4 */
|
|
2
2
|
:root {
|
|
3
3
|
--color-light-bg-primary: #fff;
|
|
4
4
|
--color-light-graphic-neutral: #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_1nq3o {
|
|
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_1nq3o {
|
|
35
35
|
overflow: hidden;
|
|
36
36
|
position: relative;
|
|
37
37
|
display: flex;
|
|
@@ -41,18 +41,18 @@
|
|
|
41
41
|
background: var(--color-light-bg-primary);
|
|
42
42
|
transform: translateY(100%);
|
|
43
43
|
}
|
|
44
|
-
.bottom-
|
|
44
|
+
.bottom-sheet__withTransition_1nq3o {
|
|
45
45
|
transition: var(--bottom-sheet-out-transition);
|
|
46
46
|
}
|
|
47
|
-
.bottom-
|
|
47
|
+
.bottom-sheet__scrollableContainer_1nq3o {
|
|
48
48
|
overflow: auto;
|
|
49
49
|
display: flex;
|
|
50
50
|
flex-direction: column;
|
|
51
51
|
position: relative;
|
|
52
52
|
height: 100%;
|
|
53
53
|
}
|
|
54
|
-
.bottom-
|
|
55
|
-
position:
|
|
54
|
+
.bottom-sheet__marker_1nq3o {
|
|
55
|
+
position: fixed;
|
|
56
56
|
top: var(--gap-2xs);
|
|
57
57
|
left: 50%;
|
|
58
58
|
width: 36px;
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
background-color: var(--color-light-graphic-neutral);
|
|
63
63
|
z-index: 1000;
|
|
64
64
|
}
|
|
65
|
-
.bottom-
|
|
65
|
+
.bottom-sheet__content_1nq3o {
|
|
66
66
|
display: flex;
|
|
67
67
|
flex-direction: column;
|
|
68
68
|
flex: 1;
|
|
@@ -70,29 +70,29 @@
|
|
|
70
70
|
color: var(--color-light-text-primary);
|
|
71
71
|
background-color: var(--color-light-bg-primary);
|
|
72
72
|
}
|
|
73
|
-
.bottom-
|
|
73
|
+
.bottom-sheet__noHeader_1nq3o {
|
|
74
74
|
padding-top: var(--gap-xl);
|
|
75
75
|
}
|
|
76
|
-
.bottom-
|
|
76
|
+
.bottom-sheet__noFooter_1nq3o {
|
|
77
77
|
padding-bottom: var(--gap-m);
|
|
78
78
|
}
|
|
79
|
-
.bottom-
|
|
79
|
+
.bottom-sheet__scrollLocked_1nq3o {
|
|
80
80
|
overflow: hidden;
|
|
81
81
|
}
|
|
82
|
-
.bottom-
|
|
82
|
+
.bottom-sheet__appear_1nq3o .bottom-sheet__component_1nq3o, .bottom-sheet__enter_1nq3o .bottom-sheet__component_1nq3o {
|
|
83
83
|
transition: none;
|
|
84
84
|
}
|
|
85
|
-
.bottom-
|
|
85
|
+
.bottom-sheet__appearActive_1nq3o .bottom-sheet__component_1nq3o, .bottom-sheet__enterActive_1nq3o .bottom-sheet__component_1nq3o {
|
|
86
86
|
transition: var(--bottom-sheet-in-transition);
|
|
87
87
|
transform: translateY(0);
|
|
88
88
|
}
|
|
89
|
-
.bottom-
|
|
89
|
+
.bottom-sheet__enterDone_1nq3o .bottom-sheet__component_1nq3o, .bottom-sheet__appearDone_1nq3o .bottom-sheet__component_1nq3o {
|
|
90
90
|
transform: translateY(0);
|
|
91
91
|
}
|
|
92
|
-
.bottom-
|
|
92
|
+
.bottom-sheet__exit_1nq3o .bottom-sheet__component_1nq3o {
|
|
93
93
|
transform: translateY(0);
|
|
94
94
|
}
|
|
95
|
-
.bottom-
|
|
95
|
+
.bottom-sheet__exitActive_1nq3o .bottom-sheet__component_1nq3o {
|
|
96
96
|
transition: var(--bottom-sheet-out-transition);
|
|
97
97
|
transform: translateY(100%);
|
|
98
98
|
}
|
package/dist/modern/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./component-
|
|
1
|
+
export * from "./component-7a1c353b";
|
package/dist/modern/index.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-7a1c353b.js';
|
|
13
13
|
import './components/footer/Component.js';
|
|
14
14
|
import '@alfalab/core-components-backdrop/dist/modern';
|
|
15
15
|
import './components/swipeable-backdrop/Component.js';
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-bottom-sheet",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Bottom sheet mobile component",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
"react-dom": "^16.9.0 || ^17.0.1"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@alfalab/core-components-backdrop": "^2.0.
|
|
24
|
-
"@alfalab/core-components-base-modal": "^4.0.
|
|
25
|
-
"@alfalab/core-components-icon-button": "^4.1.
|
|
26
|
-
"@alfalab/core-components-typography": "^2.
|
|
27
|
-
"classnames": "
|
|
28
|
-
"react-div-100vh": "
|
|
29
|
-
"react-swipeable": "
|
|
30
|
-
"react-transition-group": "
|
|
23
|
+
"@alfalab/core-components-backdrop": "^2.0.2",
|
|
24
|
+
"@alfalab/core-components-base-modal": "^4.0.1",
|
|
25
|
+
"@alfalab/core-components-icon-button": "^4.1.7",
|
|
26
|
+
"@alfalab/core-components-typography": "^2.5.1",
|
|
27
|
+
"classnames": "2.2.6",
|
|
28
|
+
"react-div-100vh": "0.7.0",
|
|
29
|
+
"react-swipeable": "5.5.1",
|
|
30
|
+
"react-transition-group": "4.4.1"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "0363f194b7d8e6d2949795b8f0570262d7028aff"
|
|
33
33
|
}
|