@alfalab/core-components-bottom-sheet 5.2.2 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{component-a31768c8.d.ts → component-d95f9ffe.d.ts} +5 -1
- package/{component-a31768c8.js → component-d95f9ffe.js} +10 -8
- package/component.js +3 -2
- package/components/backer/Component.js +2 -2
- package/components/backer/index.css +2 -2
- package/components/closer/Component.js +2 -2
- package/components/closer/index.css +2 -2
- package/components/footer/Component.js +1 -1
- package/components/footer/index.css +3 -3
- package/components/header/Component.js +3 -2
- package/components/header/index.css +16 -16
- package/components/swipeable-backdrop/Component.js +1 -1
- package/{esm/component-13675fe5.d.ts → cssm/component-5455358e.d.ts} +5 -1
- package/cssm/{component-082df5fd.js → component-5455358e.js} +7 -5
- package/cssm/component.js +2 -1
- package/cssm/components/header/Component.js +2 -1
- package/cssm/index.d.ts +1 -1
- package/cssm/index.js +2 -1
- package/{cssm/component-082df5fd.d.ts → esm/component-8d97503e.d.ts} +5 -1
- package/esm/{component-13675fe5.js → component-8d97503e.js} +9 -8
- package/esm/component.js +3 -2
- package/esm/components/backer/Component.js +2 -2
- package/esm/components/backer/index.css +2 -2
- package/esm/components/closer/Component.js +2 -2
- package/esm/components/closer/index.css +2 -2
- package/esm/components/footer/Component.js +1 -1
- package/esm/components/footer/index.css +3 -3
- package/esm/components/header/Component.js +3 -2
- package/esm/components/header/index.css +16 -16
- package/esm/components/swipeable-backdrop/Component.js +1 -1
- package/esm/index.css +14 -14
- package/esm/index.d.ts +1 -1
- package/esm/index.js +3 -2
- package/esm/{tslib.es6-c1a8448e.d.ts → tslib.es6-c005000e.d.ts} +0 -0
- package/esm/{tslib.es6-c1a8448e.js → tslib.es6-c005000e.js} +0 -0
- package/index.css +14 -14
- package/index.d.ts +1 -1
- package/index.js +3 -2
- package/modern/{component-dbd4ab19.d.ts → component-d6c1ca86.d.ts} +5 -1
- package/modern/{component-dbd4ab19.js → component-d6c1ca86.js} +5 -4
- package/modern/component.js +2 -1
- package/modern/components/backer/Component.js +1 -1
- package/modern/components/backer/index.css +2 -2
- package/modern/components/closer/Component.js +1 -1
- package/modern/components/closer/index.css +2 -2
- package/modern/components/footer/Component.js +1 -1
- package/modern/components/footer/index.css +3 -3
- package/modern/components/header/Component.js +2 -1
- package/modern/components/header/index.css +16 -16
- package/modern/index.css +14 -14
- package/modern/index.d.ts +1 -1
- package/modern/index.js +2 -1
- package/package.json +2 -1
- /package/{tslib.es6-f62bcae9.d.ts → tslib.es6-1027d96a.d.ts} +0 -0
- /package/{tslib.es6-f62bcae9.js → tslib.es6-1027d96a.js} +0 -0
|
@@ -2,11 +2,12 @@ import 'react';
|
|
|
2
2
|
import 'classnames';
|
|
3
3
|
import '@alfalab/core-components-base-modal/esm';
|
|
4
4
|
import '@alfalab/core-components-typography/esm';
|
|
5
|
-
export { a as Header } from '../../component-
|
|
5
|
+
export { a as Header } from '../../component-8d97503e.js';
|
|
6
6
|
import '../backer/Component.js';
|
|
7
7
|
import '../closer/Component.js';
|
|
8
|
-
import '../../tslib.es6-
|
|
8
|
+
import '../../tslib.es6-c005000e.js';
|
|
9
9
|
import 'react-div-100vh';
|
|
10
|
+
import 'react-merge-refs';
|
|
10
11
|
import 'react-swipeable';
|
|
11
12
|
import '../footer/Component.js';
|
|
12
13
|
import '../swipeable-backdrop/Component.js';
|
|
@@ -28,37 +28,37 @@
|
|
|
28
28
|
--bottom-sheet-title-line-height: 24px;
|
|
29
29
|
--bottom-sheet-title-font-family: var(--font-family-system);
|
|
30
30
|
--bottom-sheet-title-margin-vertical: var(--gap-2xs);
|
|
31
|
-
} .bottom-
|
|
31
|
+
} .bottom-sheet__headerWrapper_b563d {
|
|
32
32
|
padding: var(--gap-xs);
|
|
33
33
|
padding-bottom: 0;
|
|
34
34
|
background-color: var(--color-light-bg-primary);
|
|
35
35
|
border-top-right-radius: var(--border-radius-xl);
|
|
36
36
|
border-top-left-radius: var(--border-radius-xl);
|
|
37
37
|
z-index: 1;
|
|
38
|
-
} .bottom-
|
|
38
|
+
} .bottom-sheet__header_b563d {
|
|
39
39
|
display: flex;
|
|
40
|
-
} .bottom-
|
|
40
|
+
} .bottom-sheet__sticky_b563d {
|
|
41
41
|
position: sticky;
|
|
42
42
|
top: 0;
|
|
43
|
-
} .bottom-
|
|
43
|
+
} .bottom-sheet__highlighted_b563d {
|
|
44
44
|
border-bottom: var(--bottom-sheet-header-border-bottom);
|
|
45
|
-
} .bottom-
|
|
45
|
+
} .bottom-sheet__justifyEnd_b563d {
|
|
46
46
|
justify-content: flex-end;
|
|
47
|
-
} .bottom-
|
|
47
|
+
} .bottom-sheet__addon_b563d {
|
|
48
48
|
display: flex;
|
|
49
49
|
justify-content: center;
|
|
50
50
|
align-items: center;
|
|
51
51
|
min-width: 48px;
|
|
52
52
|
height: 48px;
|
|
53
|
-
} .bottom-
|
|
53
|
+
} .bottom-sheet__addonFixed_b563d {
|
|
54
54
|
position: fixed;
|
|
55
|
-
} .bottom-
|
|
55
|
+
} .bottom-sheet__addonLeft_b563d {
|
|
56
56
|
left: 0;
|
|
57
57
|
margin-left: var(--gap-xs);
|
|
58
|
-
} .bottom-
|
|
58
|
+
} .bottom-sheet__addonRight_b563d {
|
|
59
59
|
right: 0;
|
|
60
60
|
margin-right: var(--gap-xs);
|
|
61
|
-
} .bottom-
|
|
61
|
+
} .bottom-sheet__title_b563d {
|
|
62
62
|
padding: var(--gap-xs) var(--gap-xs);
|
|
63
63
|
margin: var(--bottom-sheet-title-margin-vertical) 0;
|
|
64
64
|
width: 100%;
|
|
@@ -66,18 +66,18 @@
|
|
|
66
66
|
font-weight: var(--bottom-sheet-title-font-weight);
|
|
67
67
|
line-height: var(--bottom-sheet-title-line-height);
|
|
68
68
|
font-family: var(--bottom-sheet-title-font-family);
|
|
69
|
-
} .bottom-
|
|
69
|
+
} .bottom-sheet__titleCenter_b563d {
|
|
70
70
|
text-align: center;
|
|
71
|
-
} .bottom-
|
|
71
|
+
} .bottom-sheet__titleLeft_b563d {
|
|
72
72
|
text-align: left;
|
|
73
|
-
} .bottom-
|
|
73
|
+
} .bottom-sheet__trimTitle_b563d {
|
|
74
74
|
white-space: nowrap;
|
|
75
75
|
overflow: hidden;
|
|
76
76
|
text-overflow: ellipsis;
|
|
77
|
-
} .bottom-
|
|
77
|
+
} .bottom-sheet__titleBigIndentHorizontal_b563d {
|
|
78
78
|
margin: var(--bottom-sheet-title-margin-vertical) var(--gap-4xl);
|
|
79
|
-
} .bottom-
|
|
79
|
+
} .bottom-sheet__titleIndentRight_b563d {
|
|
80
80
|
margin-right: var(--gap-4xl);
|
|
81
|
-
} .bottom-
|
|
81
|
+
} .bottom-sheet__titleIndentLeft_b563d {
|
|
82
82
|
margin-left: var(--gap-4xl);
|
|
83
83
|
}
|
package/esm/index.css
CHANGED
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
} :root {
|
|
26
26
|
--bottom-sheet-in-transition: 0.5s cubic-bezier(0.09, 0.91, 0.18, 0.99);
|
|
27
27
|
--bottom-sheet-out-transition: 0.3s ease;
|
|
28
|
-
} .bottom-
|
|
28
|
+
} .bottom-sheet__modal_8liup {
|
|
29
29
|
background-color: transparent;
|
|
30
30
|
position: fixed;
|
|
31
31
|
bottom: 0;
|
|
32
32
|
width: 100%;
|
|
33
33
|
max-width: 600px;
|
|
34
|
-
} .bottom-
|
|
34
|
+
} .bottom-sheet__component_8liup {
|
|
35
35
|
overflow: hidden;
|
|
36
36
|
position: relative;
|
|
37
37
|
display: flex;
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
border-top-left-radius: var(--border-radius-3xl);
|
|
41
41
|
background: var(--color-light-bg-primary);
|
|
42
42
|
transform: translateY(100%);
|
|
43
|
-
} .bottom-
|
|
43
|
+
} .bottom-sheet__withTransition_8liup {
|
|
44
44
|
transition: var(--bottom-sheet-out-transition);
|
|
45
|
-
} .bottom-
|
|
45
|
+
} .bottom-sheet__scrollableContainer_8liup {
|
|
46
46
|
overflow: auto;
|
|
47
47
|
display: flex;
|
|
48
48
|
flex-direction: column;
|
|
49
49
|
position: relative;
|
|
50
50
|
height: 100%;
|
|
51
|
-
} .bottom-
|
|
51
|
+
} .bottom-sheet__marker_8liup {
|
|
52
52
|
position: fixed;
|
|
53
53
|
top: var(--gap-2xs);
|
|
54
54
|
left: 50%;
|
|
@@ -58,29 +58,29 @@
|
|
|
58
58
|
transform: translateX(-50%);
|
|
59
59
|
background-color: var(--color-light-graphic-quaternary);
|
|
60
60
|
z-index: 1000;
|
|
61
|
-
} .bottom-
|
|
61
|
+
} .bottom-sheet__content_8liup {
|
|
62
62
|
display: flex;
|
|
63
63
|
flex-direction: column;
|
|
64
64
|
flex: 1;
|
|
65
65
|
padding: 0 var(--gap-m);
|
|
66
66
|
color: var(--color-light-text-primary);
|
|
67
67
|
background-color: var(--color-light-bg-primary);
|
|
68
|
-
} .bottom-
|
|
68
|
+
} .bottom-sheet__noHeader_8liup {
|
|
69
69
|
padding-top: var(--gap-xl);
|
|
70
|
-
} .bottom-
|
|
70
|
+
} .bottom-sheet__noFooter_8liup {
|
|
71
71
|
padding-bottom: var(--gap-m);
|
|
72
|
-
} .bottom-
|
|
72
|
+
} .bottom-sheet__scrollLocked_8liup {
|
|
73
73
|
overflow: hidden;
|
|
74
|
-
} .bottom-
|
|
74
|
+
} .bottom-sheet__appear_8liup .bottom-sheet__component_8liup, .bottom-sheet__enter_8liup .bottom-sheet__component_8liup {
|
|
75
75
|
transition: none;
|
|
76
|
-
} .bottom-
|
|
76
|
+
} .bottom-sheet__appearActive_8liup .bottom-sheet__component_8liup, .bottom-sheet__enterActive_8liup .bottom-sheet__component_8liup {
|
|
77
77
|
transition: var(--bottom-sheet-in-transition);
|
|
78
78
|
transform: translateY(0);
|
|
79
|
-
} .bottom-
|
|
79
|
+
} .bottom-sheet__enterDone_8liup .bottom-sheet__component_8liup, .bottom-sheet__appearDone_8liup .bottom-sheet__component_8liup {
|
|
80
80
|
transform: translateY(0);
|
|
81
|
-
} .bottom-
|
|
81
|
+
} .bottom-sheet__exit_8liup .bottom-sheet__component_8liup {
|
|
82
82
|
transform: translateY(0);
|
|
83
|
-
} .bottom-
|
|
83
|
+
} .bottom-sheet__exitActive_8liup .bottom-sheet__component_8liup {
|
|
84
84
|
transition: var(--bottom-sheet-out-transition);
|
|
85
85
|
transform: translateY(100%);
|
|
86
86
|
}
|
package/esm/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./component-
|
|
1
|
+
export * from "./component-8d97503e";
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { B as BottomSheet, C as CLOSE_OFFSET, H as HEADER_OFFSET } from './component-
|
|
2
|
-
import './tslib.es6-
|
|
1
|
+
export { B as BottomSheet, C as CLOSE_OFFSET, H as HEADER_OFFSET } from './component-8d97503e.js';
|
|
2
|
+
import './tslib.es6-c005000e.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'react-div-100vh';
|
|
5
|
+
import 'react-merge-refs';
|
|
5
6
|
import 'react-swipeable';
|
|
6
7
|
import 'classnames';
|
|
7
8
|
import '@alfalab/core-components-base-modal/esm';
|
|
File without changes
|
|
File without changes
|
package/index.css
CHANGED
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
} :root {
|
|
26
26
|
--bottom-sheet-in-transition: 0.5s cubic-bezier(0.09, 0.91, 0.18, 0.99);
|
|
27
27
|
--bottom-sheet-out-transition: 0.3s ease;
|
|
28
|
-
} .bottom-
|
|
28
|
+
} .bottom-sheet__modal_8liup {
|
|
29
29
|
background-color: transparent;
|
|
30
30
|
position: fixed;
|
|
31
31
|
bottom: 0;
|
|
32
32
|
width: 100%;
|
|
33
33
|
max-width: 600px;
|
|
34
|
-
} .bottom-
|
|
34
|
+
} .bottom-sheet__component_8liup {
|
|
35
35
|
overflow: hidden;
|
|
36
36
|
position: relative;
|
|
37
37
|
display: flex;
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
border-top-left-radius: var(--border-radius-3xl);
|
|
41
41
|
background: var(--color-light-bg-primary);
|
|
42
42
|
transform: translateY(100%);
|
|
43
|
-
} .bottom-
|
|
43
|
+
} .bottom-sheet__withTransition_8liup {
|
|
44
44
|
transition: var(--bottom-sheet-out-transition);
|
|
45
|
-
} .bottom-
|
|
45
|
+
} .bottom-sheet__scrollableContainer_8liup {
|
|
46
46
|
overflow: auto;
|
|
47
47
|
display: flex;
|
|
48
48
|
flex-direction: column;
|
|
49
49
|
position: relative;
|
|
50
50
|
height: 100%;
|
|
51
|
-
} .bottom-
|
|
51
|
+
} .bottom-sheet__marker_8liup {
|
|
52
52
|
position: fixed;
|
|
53
53
|
top: var(--gap-2xs);
|
|
54
54
|
left: 50%;
|
|
@@ -58,29 +58,29 @@
|
|
|
58
58
|
transform: translateX(-50%);
|
|
59
59
|
background-color: var(--color-light-graphic-quaternary);
|
|
60
60
|
z-index: 1000;
|
|
61
|
-
} .bottom-
|
|
61
|
+
} .bottom-sheet__content_8liup {
|
|
62
62
|
display: flex;
|
|
63
63
|
flex-direction: column;
|
|
64
64
|
flex: 1;
|
|
65
65
|
padding: 0 var(--gap-m);
|
|
66
66
|
color: var(--color-light-text-primary);
|
|
67
67
|
background-color: var(--color-light-bg-primary);
|
|
68
|
-
} .bottom-
|
|
68
|
+
} .bottom-sheet__noHeader_8liup {
|
|
69
69
|
padding-top: var(--gap-xl);
|
|
70
|
-
} .bottom-
|
|
70
|
+
} .bottom-sheet__noFooter_8liup {
|
|
71
71
|
padding-bottom: var(--gap-m);
|
|
72
|
-
} .bottom-
|
|
72
|
+
} .bottom-sheet__scrollLocked_8liup {
|
|
73
73
|
overflow: hidden;
|
|
74
|
-
} .bottom-
|
|
74
|
+
} .bottom-sheet__appear_8liup .bottom-sheet__component_8liup, .bottom-sheet__enter_8liup .bottom-sheet__component_8liup {
|
|
75
75
|
transition: none;
|
|
76
|
-
} .bottom-
|
|
76
|
+
} .bottom-sheet__appearActive_8liup .bottom-sheet__component_8liup, .bottom-sheet__enterActive_8liup .bottom-sheet__component_8liup {
|
|
77
77
|
transition: var(--bottom-sheet-in-transition);
|
|
78
78
|
transform: translateY(0);
|
|
79
|
-
} .bottom-
|
|
79
|
+
} .bottom-sheet__enterDone_8liup .bottom-sheet__component_8liup, .bottom-sheet__appearDone_8liup .bottom-sheet__component_8liup {
|
|
80
80
|
transform: translateY(0);
|
|
81
|
-
} .bottom-
|
|
81
|
+
} .bottom-sheet__exit_8liup .bottom-sheet__component_8liup {
|
|
82
82
|
transform: translateY(0);
|
|
83
|
-
} .bottom-
|
|
83
|
+
} .bottom-sheet__exitActive_8liup .bottom-sheet__component_8liup {
|
|
84
84
|
transition: var(--bottom-sheet-out-transition);
|
|
85
85
|
transform: translateY(100%);
|
|
86
86
|
}
|
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./component-
|
|
1
|
+
export * from "./component-d95f9ffe";
|
package/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var components_header_Component = require('./component-
|
|
4
|
-
require('./tslib.es6-
|
|
3
|
+
var components_header_Component = require('./component-d95f9ffe.js');
|
|
4
|
+
require('./tslib.es6-1027d96a.js');
|
|
5
5
|
require('react');
|
|
6
6
|
require('react-div-100vh');
|
|
7
|
+
require('react-merge-refs');
|
|
7
8
|
require('react-swipeable');
|
|
8
9
|
require('classnames');
|
|
9
10
|
require('@alfalab/core-components-base-modal');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react-transition-group" />
|
|
2
2
|
/// <reference types="react" />
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { FC, ReactNode, HTMLAttributes } from "react";
|
|
4
|
+
import { FC, ReactNode, HTMLAttributes, RefObject } from "react";
|
|
5
5
|
import { BottomSheetTitleAlign } from "./index";
|
|
6
6
|
import { TransitionProps } from 'react-transition-group/Transition';
|
|
7
7
|
import { BaseModalProps } from "@alfalab/core-components-base-modal";
|
|
@@ -220,6 +220,10 @@ type BottomSheetProps = {
|
|
|
220
220
|
* Свойства для Бэкдропа
|
|
221
221
|
*/
|
|
222
222
|
backdropProps?: BaseModalProps['backdropProps'];
|
|
223
|
+
/**
|
|
224
|
+
* Реф на контейнер, в котором происходит скролл
|
|
225
|
+
*/
|
|
226
|
+
scrollableContainerRef?: RefObject<HTMLElement>;
|
|
223
227
|
/**
|
|
224
228
|
* Обработчик закрытия
|
|
225
229
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useContext, useEffect, forwardRef, useState, useRef, useCallback } from 'react';
|
|
2
2
|
import { use100vh } from 'react-div-100vh';
|
|
3
|
+
import mergeRefs from 'react-merge-refs';
|
|
3
4
|
import { useSwipeable } from 'react-swipeable';
|
|
4
5
|
import cn from 'classnames';
|
|
5
6
|
import { BaseModalContext, BaseModal } from '@alfalab/core-components-base-modal/modern';
|
|
@@ -14,7 +15,7 @@ const getDataTestId = (dataTestId, element) => {
|
|
|
14
15
|
return dataTestId ? `${dataTestId}${elementPart}` : undefined;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
|
-
const styles$1 = {"headerWrapper":"bottom-
|
|
18
|
+
const styles$1 = {"headerWrapper":"bottom-sheet__headerWrapper_b563d","header":"bottom-sheet__header_b563d","sticky":"bottom-sheet__sticky_b563d","highlighted":"bottom-sheet__highlighted_b563d","justifyEnd":"bottom-sheet__justifyEnd_b563d","addon":"bottom-sheet__addon_b563d","addonFixed":"bottom-sheet__addonFixed_b563d","addonLeft":"bottom-sheet__addonLeft_b563d","addonRight":"bottom-sheet__addonRight_b563d","title":"bottom-sheet__title_b563d","titleCenter":"bottom-sheet__titleCenter_b563d","titleLeft":"bottom-sheet__titleLeft_b563d","trimTitle":"bottom-sheet__trimTitle_b563d","titleBigIndentHorizontal":"bottom-sheet__titleBigIndentHorizontal_b563d","titleIndentRight":"bottom-sheet__titleIndentRight_b563d","titleIndentLeft":"bottom-sheet__titleIndentLeft_b563d"};
|
|
18
19
|
require('./components/header/index.css')
|
|
19
20
|
|
|
20
21
|
const Header = ({ title, headerClassName, addonClassName, closerClassName, backerClassName, leftAddons, rightAddons, bottomAddons, hasCloser, hasBacker, titleAlign, trimTitle, sticky, dataTestId, onBack, }) => {
|
|
@@ -61,7 +62,7 @@ const Header = ({ title, headerClassName, addonClassName, closerClassName, backe
|
|
|
61
62
|
bottomAddons));
|
|
62
63
|
};
|
|
63
64
|
|
|
64
|
-
const styles = {"modal":"bottom-
|
|
65
|
+
const styles = {"modal":"bottom-sheet__modal_8liup","component":"bottom-sheet__component_8liup","withTransition":"bottom-sheet__withTransition_8liup","scrollableContainer":"bottom-sheet__scrollableContainer_8liup","marker":"bottom-sheet__marker_8liup","content":"bottom-sheet__content_8liup","noHeader":"bottom-sheet__noHeader_8liup","noFooter":"bottom-sheet__noFooter_8liup","scrollLocked":"bottom-sheet__scrollLocked_8liup","appear":"bottom-sheet__appear_8liup","enter":"bottom-sheet__enter_8liup","appearActive":"bottom-sheet__appearActive_8liup","enterActive":"bottom-sheet__enterActive_8liup","enterDone":"bottom-sheet__enterDone_8liup","appearDone":"bottom-sheet__appearDone_8liup","exit":"bottom-sheet__exit_8liup","exitActive":"bottom-sheet__exitActive_8liup"};
|
|
65
66
|
require('./index.css')
|
|
66
67
|
|
|
67
68
|
const TIMEOUT = 300;
|
|
@@ -72,7 +73,7 @@ const MARKET_HEIGHT = 24;
|
|
|
72
73
|
/* Верхний отступ шторки, если она открыта на максимальную высоту */
|
|
73
74
|
const HEADER_OFFSET = 24;
|
|
74
75
|
const CLOSE_OFFSET = 0.2;
|
|
75
|
-
const BottomSheet = forwardRef(({ open, title, container, 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) => {
|
|
76
|
+
const BottomSheet = forwardRef(({ open, title, container, 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, scrollableContainerRef = () => null, onClose, onBack, }, ref) => {
|
|
76
77
|
const [sheetOffset, setSheetOffset] = useState(0);
|
|
77
78
|
const [backdropOpacity, setBackdropOpacity] = useState(1);
|
|
78
79
|
const [scrollLocked, setScrollLocked] = useState(false);
|
|
@@ -229,7 +230,7 @@ const BottomSheet = forwardRef(({ open, title, container, actionButton, contentC
|
|
|
229
230
|
}, ...sheetSwipeablehandlers },
|
|
230
231
|
React.createElement("div", { ...containerProps, className: cn(styles.scrollableContainer, containerProps?.className, containerClassName, {
|
|
231
232
|
[styles.scrollLocked]: scrollLocked,
|
|
232
|
-
}), ref: scrollableContainer },
|
|
233
|
+
}), ref: mergeRefs([scrollableContainer, scrollableContainerRef]) },
|
|
233
234
|
swipeable && React.createElement("div", { className: cn(styles.marker) }),
|
|
234
235
|
!hideHeader && !emptyHeader && React.createElement(Header, { ...headerProps }),
|
|
235
236
|
React.createElement("div", { className: cn(styles.content, contentClassName, {
|
package/modern/component.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import 'react-div-100vh';
|
|
3
|
+
import 'react-merge-refs';
|
|
3
4
|
import 'react-swipeable';
|
|
4
5
|
import 'classnames';
|
|
5
6
|
import '@alfalab/core-components-base-modal/modern';
|
|
6
|
-
export { B as BottomSheet, C as CLOSE_OFFSET, H as HEADER_OFFSET } from './component-
|
|
7
|
+
export { B as BottomSheet, C as CLOSE_OFFSET, H as HEADER_OFFSET } from './component-d6c1ca86.js';
|
|
7
8
|
import './components/footer/Component.js';
|
|
8
9
|
import './components/swipeable-backdrop/Component.js';
|
|
9
10
|
import '@alfalab/core-components-typography/modern';
|
|
@@ -3,7 +3,7 @@ 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
|
-
const styles = {"backer":"bottom-
|
|
6
|
+
const styles = {"backer":"bottom-sheet__backer_f3np1","button":"bottom-sheet__button_f3np1"};
|
|
7
7
|
require('./index.css')
|
|
8
8
|
|
|
9
9
|
const Backer = ({ className, size = 'xs', icon = ArrowBackMIcon, dataTestId, onClick, ...restProps }) => (React.createElement("div", { className: cn(styles.backer, className) },
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
} :root {
|
|
19
19
|
} :root {
|
|
20
20
|
--bottom-sheet-backer-bg-color: var(--color-light-bg-primary-inverted-alpha-3);
|
|
21
|
-
} .bottom-
|
|
21
|
+
} .bottom-sheet__backer_f3np1 {
|
|
22
22
|
width: 32px;
|
|
23
23
|
height: 32px;
|
|
24
24
|
display: flex;
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
align-items: center;
|
|
27
27
|
cursor: pointer;
|
|
28
28
|
color: var(--color-light-graphic-primary);
|
|
29
|
-
} .bottom-
|
|
29
|
+
} .bottom-sheet__button_f3np1 {
|
|
30
30
|
background: var(--bottom-sheet-backer-bg-color);
|
|
31
31
|
-webkit-backdrop-filter: blur(10px);
|
|
32
32
|
backdrop-filter: blur(10px);
|
|
@@ -4,7 +4,7 @@ import { BaseModalContext } from '@alfalab/core-components-base-modal/modern';
|
|
|
4
4
|
import { IconButton } from '@alfalab/core-components-icon-button/modern';
|
|
5
5
|
import { CrossMIcon } from '@alfalab/icons-glyph/CrossMIcon';
|
|
6
6
|
|
|
7
|
-
const styles = {"closer":"bottom-
|
|
7
|
+
const styles = {"closer":"bottom-sheet__closer_tnhi0","button":"bottom-sheet__button_tnhi0"};
|
|
8
8
|
require('./index.css')
|
|
9
9
|
|
|
10
10
|
const Closer = ({ className, size = 'xs', icon = CrossMIcon, dataTestId, ...restProps }) => {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
} :root {
|
|
19
19
|
} :root {
|
|
20
20
|
--bottom-sheet-closer-bg-color: var(--color-light-bg-primary-inverted-alpha-3);
|
|
21
|
-
} .bottom-
|
|
21
|
+
} .bottom-sheet__closer_tnhi0 {
|
|
22
22
|
width: 32px;
|
|
23
23
|
height: 32px;
|
|
24
24
|
display: flex;
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
align-items: center;
|
|
27
27
|
cursor: pointer;
|
|
28
28
|
color: var(--color-light-graphic-primary);
|
|
29
|
-
} .bottom-
|
|
29
|
+
} .bottom-sheet__button_tnhi0 {
|
|
30
30
|
background: var(--bottom-sheet-closer-bg-color);
|
|
31
31
|
-webkit-backdrop-filter: blur(10px);
|
|
32
32
|
backdrop-filter: blur(10px);
|
|
@@ -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_3abbw","sticky":"bottom-sheet__sticky_3abbw","highlighted":"bottom-sheet__highlighted_3abbw"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
const Footer = ({ children, className, sticky }) => {
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
} :root {
|
|
21
21
|
--bottom-sheet-footer-border-top: 1px solid var(--color-light-border-primary);
|
|
22
22
|
--bottom-sheet-footer-background-color: var(--color-light-bg-primary);
|
|
23
|
-
} .bottom-
|
|
23
|
+
} .bottom-sheet__footer_3abbw {
|
|
24
24
|
padding: var(--gap-m) var(--gap-m);
|
|
25
25
|
background-color: var(--color-light-bg-primary);
|
|
26
|
-
} .bottom-
|
|
26
|
+
} .bottom-sheet__sticky_3abbw {
|
|
27
27
|
position: sticky;
|
|
28
28
|
bottom: 0;
|
|
29
|
-
} .bottom-
|
|
29
|
+
} .bottom-sheet__highlighted_3abbw {
|
|
30
30
|
border-top: var(--bottom-sheet-footer-border-top);
|
|
31
31
|
background-color: var(--bottom-sheet-footer-background-color);
|
|
32
32
|
}
|
|
@@ -2,10 +2,11 @@ import 'react';
|
|
|
2
2
|
import 'classnames';
|
|
3
3
|
import '@alfalab/core-components-base-modal/modern';
|
|
4
4
|
import '@alfalab/core-components-typography/modern';
|
|
5
|
-
export { a as Header } from '../../component-
|
|
5
|
+
export { a as Header } from '../../component-d6c1ca86.js';
|
|
6
6
|
import '../backer/Component.js';
|
|
7
7
|
import '../closer/Component.js';
|
|
8
8
|
import 'react-div-100vh';
|
|
9
|
+
import 'react-merge-refs';
|
|
9
10
|
import 'react-swipeable';
|
|
10
11
|
import '../footer/Component.js';
|
|
11
12
|
import '../swipeable-backdrop/Component.js';
|
|
@@ -28,37 +28,37 @@
|
|
|
28
28
|
--bottom-sheet-title-line-height: 24px;
|
|
29
29
|
--bottom-sheet-title-font-family: var(--font-family-system);
|
|
30
30
|
--bottom-sheet-title-margin-vertical: var(--gap-2xs);
|
|
31
|
-
} .bottom-
|
|
31
|
+
} .bottom-sheet__headerWrapper_b563d {
|
|
32
32
|
padding: var(--gap-xs);
|
|
33
33
|
padding-bottom: 0;
|
|
34
34
|
background-color: var(--color-light-bg-primary);
|
|
35
35
|
border-top-right-radius: var(--border-radius-xl);
|
|
36
36
|
border-top-left-radius: var(--border-radius-xl);
|
|
37
37
|
z-index: 1;
|
|
38
|
-
} .bottom-
|
|
38
|
+
} .bottom-sheet__header_b563d {
|
|
39
39
|
display: flex;
|
|
40
|
-
} .bottom-
|
|
40
|
+
} .bottom-sheet__sticky_b563d {
|
|
41
41
|
position: sticky;
|
|
42
42
|
top: 0;
|
|
43
|
-
} .bottom-
|
|
43
|
+
} .bottom-sheet__highlighted_b563d {
|
|
44
44
|
border-bottom: var(--bottom-sheet-header-border-bottom);
|
|
45
|
-
} .bottom-
|
|
45
|
+
} .bottom-sheet__justifyEnd_b563d {
|
|
46
46
|
justify-content: flex-end;
|
|
47
|
-
} .bottom-
|
|
47
|
+
} .bottom-sheet__addon_b563d {
|
|
48
48
|
display: flex;
|
|
49
49
|
justify-content: center;
|
|
50
50
|
align-items: center;
|
|
51
51
|
min-width: 48px;
|
|
52
52
|
height: 48px;
|
|
53
|
-
} .bottom-
|
|
53
|
+
} .bottom-sheet__addonFixed_b563d {
|
|
54
54
|
position: fixed;
|
|
55
|
-
} .bottom-
|
|
55
|
+
} .bottom-sheet__addonLeft_b563d {
|
|
56
56
|
left: 0;
|
|
57
57
|
margin-left: var(--gap-xs);
|
|
58
|
-
} .bottom-
|
|
58
|
+
} .bottom-sheet__addonRight_b563d {
|
|
59
59
|
right: 0;
|
|
60
60
|
margin-right: var(--gap-xs);
|
|
61
|
-
} .bottom-
|
|
61
|
+
} .bottom-sheet__title_b563d {
|
|
62
62
|
padding: var(--gap-xs) var(--gap-xs);
|
|
63
63
|
margin: var(--bottom-sheet-title-margin-vertical) 0;
|
|
64
64
|
width: 100%;
|
|
@@ -66,18 +66,18 @@
|
|
|
66
66
|
font-weight: var(--bottom-sheet-title-font-weight);
|
|
67
67
|
line-height: var(--bottom-sheet-title-line-height);
|
|
68
68
|
font-family: var(--bottom-sheet-title-font-family);
|
|
69
|
-
} .bottom-
|
|
69
|
+
} .bottom-sheet__titleCenter_b563d {
|
|
70
70
|
text-align: center;
|
|
71
|
-
} .bottom-
|
|
71
|
+
} .bottom-sheet__titleLeft_b563d {
|
|
72
72
|
text-align: left;
|
|
73
|
-
} .bottom-
|
|
73
|
+
} .bottom-sheet__trimTitle_b563d {
|
|
74
74
|
white-space: nowrap;
|
|
75
75
|
overflow: hidden;
|
|
76
76
|
text-overflow: ellipsis;
|
|
77
|
-
} .bottom-
|
|
77
|
+
} .bottom-sheet__titleBigIndentHorizontal_b563d {
|
|
78
78
|
margin: var(--bottom-sheet-title-margin-vertical) var(--gap-4xl);
|
|
79
|
-
} .bottom-
|
|
79
|
+
} .bottom-sheet__titleIndentRight_b563d {
|
|
80
80
|
margin-right: var(--gap-4xl);
|
|
81
|
-
} .bottom-
|
|
81
|
+
} .bottom-sheet__titleIndentLeft_b563d {
|
|
82
82
|
margin-left: var(--gap-4xl);
|
|
83
83
|
}
|
package/modern/index.css
CHANGED
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
} :root {
|
|
26
26
|
--bottom-sheet-in-transition: 0.5s cubic-bezier(0.09, 0.91, 0.18, 0.99);
|
|
27
27
|
--bottom-sheet-out-transition: 0.3s ease;
|
|
28
|
-
} .bottom-
|
|
28
|
+
} .bottom-sheet__modal_8liup {
|
|
29
29
|
background-color: transparent;
|
|
30
30
|
position: fixed;
|
|
31
31
|
bottom: 0;
|
|
32
32
|
width: 100%;
|
|
33
33
|
max-width: 600px;
|
|
34
|
-
} .bottom-
|
|
34
|
+
} .bottom-sheet__component_8liup {
|
|
35
35
|
overflow: hidden;
|
|
36
36
|
position: relative;
|
|
37
37
|
display: flex;
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
border-top-left-radius: var(--border-radius-3xl);
|
|
41
41
|
background: var(--color-light-bg-primary);
|
|
42
42
|
transform: translateY(100%);
|
|
43
|
-
} .bottom-
|
|
43
|
+
} .bottom-sheet__withTransition_8liup {
|
|
44
44
|
transition: var(--bottom-sheet-out-transition);
|
|
45
|
-
} .bottom-
|
|
45
|
+
} .bottom-sheet__scrollableContainer_8liup {
|
|
46
46
|
overflow: auto;
|
|
47
47
|
display: flex;
|
|
48
48
|
flex-direction: column;
|
|
49
49
|
position: relative;
|
|
50
50
|
height: 100%;
|
|
51
|
-
} .bottom-
|
|
51
|
+
} .bottom-sheet__marker_8liup {
|
|
52
52
|
position: fixed;
|
|
53
53
|
top: var(--gap-2xs);
|
|
54
54
|
left: 50%;
|
|
@@ -58,29 +58,29 @@
|
|
|
58
58
|
transform: translateX(-50%);
|
|
59
59
|
background-color: var(--color-light-graphic-quaternary);
|
|
60
60
|
z-index: 1000;
|
|
61
|
-
} .bottom-
|
|
61
|
+
} .bottom-sheet__content_8liup {
|
|
62
62
|
display: flex;
|
|
63
63
|
flex-direction: column;
|
|
64
64
|
flex: 1;
|
|
65
65
|
padding: 0 var(--gap-m);
|
|
66
66
|
color: var(--color-light-text-primary);
|
|
67
67
|
background-color: var(--color-light-bg-primary);
|
|
68
|
-
} .bottom-
|
|
68
|
+
} .bottom-sheet__noHeader_8liup {
|
|
69
69
|
padding-top: var(--gap-xl);
|
|
70
|
-
} .bottom-
|
|
70
|
+
} .bottom-sheet__noFooter_8liup {
|
|
71
71
|
padding-bottom: var(--gap-m);
|
|
72
|
-
} .bottom-
|
|
72
|
+
} .bottom-sheet__scrollLocked_8liup {
|
|
73
73
|
overflow: hidden;
|
|
74
|
-
} .bottom-
|
|
74
|
+
} .bottom-sheet__appear_8liup .bottom-sheet__component_8liup, .bottom-sheet__enter_8liup .bottom-sheet__component_8liup {
|
|
75
75
|
transition: none;
|
|
76
|
-
} .bottom-
|
|
76
|
+
} .bottom-sheet__appearActive_8liup .bottom-sheet__component_8liup, .bottom-sheet__enterActive_8liup .bottom-sheet__component_8liup {
|
|
77
77
|
transition: var(--bottom-sheet-in-transition);
|
|
78
78
|
transform: translateY(0);
|
|
79
|
-
} .bottom-
|
|
79
|
+
} .bottom-sheet__enterDone_8liup .bottom-sheet__component_8liup, .bottom-sheet__appearDone_8liup .bottom-sheet__component_8liup {
|
|
80
80
|
transform: translateY(0);
|
|
81
|
-
} .bottom-
|
|
81
|
+
} .bottom-sheet__exit_8liup .bottom-sheet__component_8liup {
|
|
82
82
|
transform: translateY(0);
|
|
83
|
-
} .bottom-
|
|
83
|
+
} .bottom-sheet__exitActive_8liup .bottom-sheet__component_8liup {
|
|
84
84
|
transition: var(--bottom-sheet-out-transition);
|
|
85
85
|
transform: translateY(100%);
|
|
86
86
|
}
|
package/modern/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./component-
|
|
1
|
+
export * from "./component-d6c1ca86";
|
package/modern/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { B as BottomSheet, C as CLOSE_OFFSET, H as HEADER_OFFSET } from './component-
|
|
1
|
+
export { B as BottomSheet, C as CLOSE_OFFSET, H as HEADER_OFFSET } from './component-d6c1ca86.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'react-div-100vh';
|
|
4
|
+
import 'react-merge-refs';
|
|
4
5
|
import 'react-swipeable';
|
|
5
6
|
import 'classnames';
|
|
6
7
|
import '@alfalab/core-components-base-modal/modern';
|