@alfalab/core-components-popup-sheet 1.0.1 → 1.0.3
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 +1 -1
- package/components/backdrop/Component.js +1 -1
- package/components/backdrop/index.css +10 -10
- package/cssm/types-1b036d4b.d.ts +13 -0
- package/cssm/useSkeleton-1b036d4b.d.ts +40 -0
- package/esm/Component.js +1 -1
- package/esm/components/backdrop/Component.js +1 -1
- package/esm/components/backdrop/index.css +10 -10
- package/esm/index.css +14 -14
- package/esm/types-1b036d4b.d.ts +13 -0
- package/esm/useSkeleton-1b036d4b.d.ts +40 -0
- package/index.css +14 -14
- package/modern/Component.js +1 -1
- package/modern/components/backdrop/Component.js +1 -1
- package/modern/components/backdrop/index.css +10 -10
- package/modern/index.css +14 -14
- package/modern/types-1b036d4b.d.ts +13 -0
- package/modern/useSkeleton-1b036d4b.d.ts +40 -0
- package/package.json +3 -3
- package/types-1b036d4b.d.ts +13 -0
- package/useSkeleton-1b036d4b.d.ts +40 -0
package/Component.js
CHANGED
|
@@ -17,7 +17,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
17
17
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
18
18
|
var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
|
|
19
19
|
|
|
20
|
-
var styles = {"component":"popup-
|
|
20
|
+
var styles = {"component":"popup-sheet__component_idtln","closer":"popup-sheet__closer_idtln","content":"popup-sheet__content_idtln","appear":"popup-sheet__appear_idtln","enter":"popup-sheet__enter_idtln","appearActive":"popup-sheet__appearActive_idtln","enterActive":"popup-sheet__enterActive_idtln","exit":"popup-sheet__exit_idtln","exitBySwipe":"popup-sheet__exitBySwipe_idtln","exitActiveBySwipe":"popup-sheet__exitActiveBySwipe_idtln","exitActive":"popup-sheet__exitActive_idtln","exitDone":"popup-sheet__exitDone_idtln"};
|
|
21
21
|
require('./index.css')
|
|
22
22
|
|
|
23
23
|
var SWIPE_VELOCITY = 0.3;
|
|
@@ -10,7 +10,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
12
12
|
|
|
13
|
-
var styles = {"appear":"popup-
|
|
13
|
+
var styles = {"appear":"popup-sheet__appear_te8l5","enter":"popup-sheet__enter_te8l5","appearActive":"popup-sheet__appearActive_te8l5","enterActive":"popup-sheet__enterActive_te8l5","appearDone":"popup-sheet__appearDone_te8l5","enterDone":"popup-sheet__enterDone_te8l5","exit":"popup-sheet__exit_te8l5","exitActive":"popup-sheet__exitActive_te8l5","exitDone":"popup-sheet__exitDone_te8l5"};
|
|
14
14
|
require('./index.css')
|
|
15
15
|
|
|
16
16
|
var PopupBackdrop = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1oh6g */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-overlay: rgba(0, 0, 0, 0.6); /* 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 */
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
} :root {
|
|
19
19
|
--backdrop-visible-background: var(--color-light-bg-overlay);
|
|
20
20
|
--backdrop-hidden-background: transparent;
|
|
21
|
-
} .popup-
|
|
22
|
-
.popup-
|
|
21
|
+
} .popup-sheet__appear_te8l5,
|
|
22
|
+
.popup-sheet__enter_te8l5 {
|
|
23
23
|
background-color: var(--backdrop-hidden-background);
|
|
24
|
-
} .popup-
|
|
25
|
-
.popup-
|
|
26
|
-
.popup-
|
|
27
|
-
.popup-
|
|
24
|
+
} .popup-sheet__appearActive_te8l5,
|
|
25
|
+
.popup-sheet__enterActive_te8l5,
|
|
26
|
+
.popup-sheet__appearDone_te8l5,
|
|
27
|
+
.popup-sheet__enterDone_te8l5 {
|
|
28
28
|
background-color: var(--backdrop-visible-background);
|
|
29
29
|
transition: background-color 300ms cubic-bezier(0.65, 0, 0.35, 1);
|
|
30
|
-
} .popup-
|
|
30
|
+
} .popup-sheet__exit_te8l5 {
|
|
31
31
|
background-color: var(--backdrop-visible-background);
|
|
32
|
-
} .popup-
|
|
33
|
-
.popup-
|
|
32
|
+
} .popup-sheet__exitActive_te8l5,
|
|
33
|
+
.popup-sheet__exitDone_te8l5 {
|
|
34
34
|
background-color: var(--backdrop-hidden-background);
|
|
35
35
|
transition: background-color 300ms cubic-bezier(0.65, 0, 0.35, 1);
|
|
36
36
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
|
|
2
|
+
type WidthUnit = number | string;
|
|
3
|
+
type TextSkeletonProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Кол-во строк текста
|
|
6
|
+
*/
|
|
7
|
+
rows?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Ширина строки
|
|
10
|
+
*/
|
|
11
|
+
width?: WidthUnit | WidthUnit[];
|
|
12
|
+
};
|
|
13
|
+
export { TextElementType, TextSkeletonProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import { TextSkeletonProps } from "./types-1b036d4b";
|
|
5
|
+
type SkeletonProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Флаг, явно задающий состояние, при котором контент закрывается прелоадером
|
|
8
|
+
*/
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Флаг явного включения анимации скелета
|
|
12
|
+
*/
|
|
13
|
+
animate?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Дополнительный класс
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Дополнительные инлайн стили
|
|
20
|
+
*/
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
/**
|
|
23
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
24
|
+
*/
|
|
25
|
+
dataTestId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Дочерние элементы.
|
|
28
|
+
*/
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
};
|
|
31
|
+
declare const Skeleton: React.FC<SkeletonProps>;
|
|
32
|
+
type SkeletonProps$0 = {
|
|
33
|
+
wrapperClassName?: string;
|
|
34
|
+
dataTestId?: string;
|
|
35
|
+
};
|
|
36
|
+
declare function useSkeleton(showSkeleton?: boolean, skeletonProps?: TextSkeletonProps): {
|
|
37
|
+
renderSkeleton: (props: SkeletonProps$0) => React.JSX.Element | null;
|
|
38
|
+
textRef: React.RefObject<HTMLElement>;
|
|
39
|
+
};
|
|
40
|
+
export { SkeletonProps, Skeleton, useSkeleton };
|
package/esm/Component.js
CHANGED
|
@@ -8,7 +8,7 @@ import { createPaddingStyle, getDataTestId, easingFns } from '@alfalab/core-comp
|
|
|
8
8
|
import { PopupBackdrop } from './components/backdrop/Component.js';
|
|
9
9
|
import '@alfalab/core-components-backdrop/esm';
|
|
10
10
|
|
|
11
|
-
var styles = {"component":"popup-
|
|
11
|
+
var styles = {"component":"popup-sheet__component_idtln","closer":"popup-sheet__closer_idtln","content":"popup-sheet__content_idtln","appear":"popup-sheet__appear_idtln","enter":"popup-sheet__enter_idtln","appearActive":"popup-sheet__appearActive_idtln","enterActive":"popup-sheet__enterActive_idtln","exit":"popup-sheet__exit_idtln","exitBySwipe":"popup-sheet__exitBySwipe_idtln","exitActiveBySwipe":"popup-sheet__exitActiveBySwipe_idtln","exitActive":"popup-sheet__exitActive_idtln","exitDone":"popup-sheet__exitDone_idtln"};
|
|
12
12
|
require('./index.css')
|
|
13
13
|
|
|
14
14
|
var SWIPE_VELOCITY = 0.3;
|
|
@@ -2,7 +2,7 @@ import { __rest, __assign } from 'tslib';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Backdrop } from '@alfalab/core-components-backdrop/esm';
|
|
4
4
|
|
|
5
|
-
var styles = {"appear":"popup-
|
|
5
|
+
var styles = {"appear":"popup-sheet__appear_te8l5","enter":"popup-sheet__enter_te8l5","appearActive":"popup-sheet__appearActive_te8l5","enterActive":"popup-sheet__enterActive_te8l5","appearDone":"popup-sheet__appearDone_te8l5","enterDone":"popup-sheet__enterDone_te8l5","exit":"popup-sheet__exit_te8l5","exitActive":"popup-sheet__exitActive_te8l5","exitDone":"popup-sheet__exitDone_te8l5"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
var PopupBackdrop = function (_a) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1oh6g */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-overlay: rgba(0, 0, 0, 0.6); /* 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 */
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
} :root {
|
|
19
19
|
--backdrop-visible-background: var(--color-light-bg-overlay);
|
|
20
20
|
--backdrop-hidden-background: transparent;
|
|
21
|
-
} .popup-
|
|
22
|
-
.popup-
|
|
21
|
+
} .popup-sheet__appear_te8l5,
|
|
22
|
+
.popup-sheet__enter_te8l5 {
|
|
23
23
|
background-color: var(--backdrop-hidden-background);
|
|
24
|
-
} .popup-
|
|
25
|
-
.popup-
|
|
26
|
-
.popup-
|
|
27
|
-
.popup-
|
|
24
|
+
} .popup-sheet__appearActive_te8l5,
|
|
25
|
+
.popup-sheet__enterActive_te8l5,
|
|
26
|
+
.popup-sheet__appearDone_te8l5,
|
|
27
|
+
.popup-sheet__enterDone_te8l5 {
|
|
28
28
|
background-color: var(--backdrop-visible-background);
|
|
29
29
|
transition: background-color 300ms cubic-bezier(0.65, 0, 0.35, 1);
|
|
30
|
-
} .popup-
|
|
30
|
+
} .popup-sheet__exit_te8l5 {
|
|
31
31
|
background-color: var(--backdrop-visible-background);
|
|
32
|
-
} .popup-
|
|
33
|
-
.popup-
|
|
32
|
+
} .popup-sheet__exitActive_te8l5,
|
|
33
|
+
.popup-sheet__exitDone_te8l5 {
|
|
34
34
|
background-color: var(--backdrop-hidden-background);
|
|
35
35
|
transition: background-color 300ms cubic-bezier(0.65, 0, 0.35, 1);
|
|
36
36
|
}
|
package/esm/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: tbevv */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root { /* 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 */
|
|
4
4
|
} :root { /* 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 */
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
--gap-xs: 8px;
|
|
16
16
|
} :root {
|
|
17
17
|
} :root {
|
|
18
|
-
} .popup-
|
|
18
|
+
} .popup-sheet__component_idtln {
|
|
19
19
|
position: fixed;
|
|
20
20
|
bottom: 0;
|
|
21
21
|
margin: auto var(--gap-xs) var(--gap-xs);
|
|
@@ -23,31 +23,31 @@
|
|
|
23
23
|
max-width: 600px;
|
|
24
24
|
border-radius: 36px;
|
|
25
25
|
overflow: hidden;
|
|
26
|
-
} .popup-
|
|
26
|
+
} .popup-sheet__closer_idtln {
|
|
27
27
|
position: absolute;
|
|
28
28
|
top: 8px;
|
|
29
29
|
right: 8px
|
|
30
|
-
} .popup-
|
|
30
|
+
} .popup-sheet__closer_idtln > button {
|
|
31
31
|
-webkit-backdrop-filter: none;
|
|
32
32
|
backdrop-filter: none;
|
|
33
|
-
} .popup-
|
|
33
|
+
} .popup-sheet__content_idtln {
|
|
34
34
|
box-sizing: border-box;
|
|
35
|
-
} /* 100px нужны для того, чтобы фон успевал немного затемниться перед тем, как начнет выезжать шторка */ .popup-
|
|
36
|
-
.popup-
|
|
35
|
+
} /* 100px нужны для того, чтобы фон успевал немного затемниться перед тем, как начнет выезжать шторка */ .popup-sheet__appear_idtln,
|
|
36
|
+
.popup-sheet__enter_idtln {
|
|
37
37
|
transform: translateY(calc(100% + 100px));
|
|
38
|
-
} .popup-
|
|
39
|
-
.popup-
|
|
38
|
+
} .popup-sheet__appearActive_idtln,
|
|
39
|
+
.popup-sheet__enterActive_idtln {
|
|
40
40
|
transform: translateY(0);
|
|
41
41
|
transition: transform 300ms cubic-bezier(0.65, 0, 0.35, 1);
|
|
42
42
|
transition-delay: 50ms;
|
|
43
|
-
} .popup-
|
|
43
|
+
} .popup-sheet__exit_idtln {
|
|
44
44
|
transform: translateY(0);
|
|
45
|
-
} .popup-
|
|
45
|
+
} .popup-sheet__exitBySwipe_idtln {
|
|
46
46
|
transform: translateY(calc(100% + 100px));
|
|
47
|
-
} .popup-
|
|
47
|
+
} .popup-sheet__exitActiveBySwipe_idtln {
|
|
48
48
|
transition: none;
|
|
49
|
-
} .popup-
|
|
50
|
-
.popup-
|
|
49
|
+
} .popup-sheet__exitActive_idtln,
|
|
50
|
+
.popup-sheet__exitDone_idtln {
|
|
51
51
|
transform: translateY(calc(100% + 100px));
|
|
52
52
|
transition: transform 300ms cubic-bezier(0.65, 0, 0.35, 1);
|
|
53
53
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
|
|
2
|
+
type WidthUnit = number | string;
|
|
3
|
+
type TextSkeletonProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Кол-во строк текста
|
|
6
|
+
*/
|
|
7
|
+
rows?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Ширина строки
|
|
10
|
+
*/
|
|
11
|
+
width?: WidthUnit | WidthUnit[];
|
|
12
|
+
};
|
|
13
|
+
export { TextElementType, TextSkeletonProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import { TextSkeletonProps } from "./types-1b036d4b";
|
|
5
|
+
type SkeletonProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Флаг, явно задающий состояние, при котором контент закрывается прелоадером
|
|
8
|
+
*/
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Флаг явного включения анимации скелета
|
|
12
|
+
*/
|
|
13
|
+
animate?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Дополнительный класс
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Дополнительные инлайн стили
|
|
20
|
+
*/
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
/**
|
|
23
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
24
|
+
*/
|
|
25
|
+
dataTestId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Дочерние элементы.
|
|
28
|
+
*/
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
};
|
|
31
|
+
declare const Skeleton: React.FC<SkeletonProps>;
|
|
32
|
+
type SkeletonProps$0 = {
|
|
33
|
+
wrapperClassName?: string;
|
|
34
|
+
dataTestId?: string;
|
|
35
|
+
};
|
|
36
|
+
declare function useSkeleton(showSkeleton?: boolean, skeletonProps?: TextSkeletonProps): {
|
|
37
|
+
renderSkeleton: (props: SkeletonProps$0) => React.JSX.Element | null;
|
|
38
|
+
textRef: React.RefObject<HTMLElement>;
|
|
39
|
+
};
|
|
40
|
+
export { SkeletonProps, Skeleton, useSkeleton };
|
package/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: tbevv */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root { /* 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 */
|
|
4
4
|
} :root { /* 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 */
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
--gap-xs: 8px;
|
|
16
16
|
} :root {
|
|
17
17
|
} :root {
|
|
18
|
-
} .popup-
|
|
18
|
+
} .popup-sheet__component_idtln {
|
|
19
19
|
position: fixed;
|
|
20
20
|
bottom: 0;
|
|
21
21
|
margin: auto var(--gap-xs) var(--gap-xs);
|
|
@@ -23,31 +23,31 @@
|
|
|
23
23
|
max-width: 600px;
|
|
24
24
|
border-radius: 36px;
|
|
25
25
|
overflow: hidden;
|
|
26
|
-
} .popup-
|
|
26
|
+
} .popup-sheet__closer_idtln {
|
|
27
27
|
position: absolute;
|
|
28
28
|
top: 8px;
|
|
29
29
|
right: 8px
|
|
30
|
-
} .popup-
|
|
30
|
+
} .popup-sheet__closer_idtln > button {
|
|
31
31
|
-webkit-backdrop-filter: none;
|
|
32
32
|
backdrop-filter: none;
|
|
33
|
-
} .popup-
|
|
33
|
+
} .popup-sheet__content_idtln {
|
|
34
34
|
box-sizing: border-box;
|
|
35
|
-
} /* 100px нужны для того, чтобы фон успевал немного затемниться перед тем, как начнет выезжать шторка */ .popup-
|
|
36
|
-
.popup-
|
|
35
|
+
} /* 100px нужны для того, чтобы фон успевал немного затемниться перед тем, как начнет выезжать шторка */ .popup-sheet__appear_idtln,
|
|
36
|
+
.popup-sheet__enter_idtln {
|
|
37
37
|
transform: translateY(calc(100% + 100px));
|
|
38
|
-
} .popup-
|
|
39
|
-
.popup-
|
|
38
|
+
} .popup-sheet__appearActive_idtln,
|
|
39
|
+
.popup-sheet__enterActive_idtln {
|
|
40
40
|
transform: translateY(0);
|
|
41
41
|
transition: transform 300ms cubic-bezier(0.65, 0, 0.35, 1);
|
|
42
42
|
transition-delay: 50ms;
|
|
43
|
-
} .popup-
|
|
43
|
+
} .popup-sheet__exit_idtln {
|
|
44
44
|
transform: translateY(0);
|
|
45
|
-
} .popup-
|
|
45
|
+
} .popup-sheet__exitBySwipe_idtln {
|
|
46
46
|
transform: translateY(calc(100% + 100px));
|
|
47
|
-
} .popup-
|
|
47
|
+
} .popup-sheet__exitActiveBySwipe_idtln {
|
|
48
48
|
transition: none;
|
|
49
|
-
} .popup-
|
|
50
|
-
.popup-
|
|
49
|
+
} .popup-sheet__exitActive_idtln,
|
|
50
|
+
.popup-sheet__exitDone_idtln {
|
|
51
51
|
transform: translateY(calc(100% + 100px));
|
|
52
52
|
transition: transform 300ms cubic-bezier(0.65, 0, 0.35, 1);
|
|
53
53
|
}
|
package/modern/Component.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createPaddingStyle, getDataTestId, easingFns } from '@alfalab/core-comp
|
|
|
7
7
|
import { PopupBackdrop } from './components/backdrop/Component.js';
|
|
8
8
|
import '@alfalab/core-components-backdrop/modern';
|
|
9
9
|
|
|
10
|
-
const styles = {"component":"popup-
|
|
10
|
+
const styles = {"component":"popup-sheet__component_idtln","closer":"popup-sheet__closer_idtln","content":"popup-sheet__content_idtln","appear":"popup-sheet__appear_idtln","enter":"popup-sheet__enter_idtln","appearActive":"popup-sheet__appearActive_idtln","enterActive":"popup-sheet__enterActive_idtln","exit":"popup-sheet__exit_idtln","exitBySwipe":"popup-sheet__exitBySwipe_idtln","exitActiveBySwipe":"popup-sheet__exitActiveBySwipe_idtln","exitActive":"popup-sheet__exitActive_idtln","exitDone":"popup-sheet__exitDone_idtln"};
|
|
11
11
|
require('./index.css')
|
|
12
12
|
|
|
13
13
|
const SWIPE_VELOCITY = 0.3;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Backdrop } from '@alfalab/core-components-backdrop/modern';
|
|
3
3
|
|
|
4
|
-
const styles = {"appear":"popup-
|
|
4
|
+
const styles = {"appear":"popup-sheet__appear_te8l5","enter":"popup-sheet__enter_te8l5","appearActive":"popup-sheet__appearActive_te8l5","enterActive":"popup-sheet__enterActive_te8l5","appearDone":"popup-sheet__appearDone_te8l5","enterDone":"popup-sheet__enterDone_te8l5","exit":"popup-sheet__exit_te8l5","exitActive":"popup-sheet__exitActive_te8l5","exitDone":"popup-sheet__exitDone_te8l5"};
|
|
5
5
|
require('./index.css')
|
|
6
6
|
|
|
7
7
|
const PopupBackdrop = ({ opacity, opacityTimeout, style, ...backdropProps }) => (React.createElement("div", { style: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1oh6g */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-bg-overlay: rgba(0, 0, 0, 0.6); /* 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 */
|
|
@@ -18,19 +18,19 @@
|
|
|
18
18
|
} :root {
|
|
19
19
|
--backdrop-visible-background: var(--color-light-bg-overlay);
|
|
20
20
|
--backdrop-hidden-background: transparent;
|
|
21
|
-
} .popup-
|
|
22
|
-
.popup-
|
|
21
|
+
} .popup-sheet__appear_te8l5,
|
|
22
|
+
.popup-sheet__enter_te8l5 {
|
|
23
23
|
background-color: var(--backdrop-hidden-background);
|
|
24
|
-
} .popup-
|
|
25
|
-
.popup-
|
|
26
|
-
.popup-
|
|
27
|
-
.popup-
|
|
24
|
+
} .popup-sheet__appearActive_te8l5,
|
|
25
|
+
.popup-sheet__enterActive_te8l5,
|
|
26
|
+
.popup-sheet__appearDone_te8l5,
|
|
27
|
+
.popup-sheet__enterDone_te8l5 {
|
|
28
28
|
background-color: var(--backdrop-visible-background);
|
|
29
29
|
transition: background-color 300ms cubic-bezier(0.65, 0, 0.35, 1);
|
|
30
|
-
} .popup-
|
|
30
|
+
} .popup-sheet__exit_te8l5 {
|
|
31
31
|
background-color: var(--backdrop-visible-background);
|
|
32
|
-
} .popup-
|
|
33
|
-
.popup-
|
|
32
|
+
} .popup-sheet__exitActive_te8l5,
|
|
33
|
+
.popup-sheet__exitDone_te8l5 {
|
|
34
34
|
background-color: var(--backdrop-hidden-background);
|
|
35
35
|
transition: background-color 300ms cubic-bezier(0.65, 0, 0.35, 1);
|
|
36
36
|
}
|
package/modern/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: tbevv */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root { /* 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 */
|
|
4
4
|
} :root { /* 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 */
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
--gap-xs: 8px;
|
|
16
16
|
} :root {
|
|
17
17
|
} :root {
|
|
18
|
-
} .popup-
|
|
18
|
+
} .popup-sheet__component_idtln {
|
|
19
19
|
position: fixed;
|
|
20
20
|
bottom: 0;
|
|
21
21
|
margin: auto var(--gap-xs) var(--gap-xs);
|
|
@@ -23,31 +23,31 @@
|
|
|
23
23
|
max-width: 600px;
|
|
24
24
|
border-radius: 36px;
|
|
25
25
|
overflow: hidden;
|
|
26
|
-
} .popup-
|
|
26
|
+
} .popup-sheet__closer_idtln {
|
|
27
27
|
position: absolute;
|
|
28
28
|
top: 8px;
|
|
29
29
|
right: 8px
|
|
30
|
-
} .popup-
|
|
30
|
+
} .popup-sheet__closer_idtln > button {
|
|
31
31
|
-webkit-backdrop-filter: none;
|
|
32
32
|
backdrop-filter: none;
|
|
33
|
-
} .popup-
|
|
33
|
+
} .popup-sheet__content_idtln {
|
|
34
34
|
box-sizing: border-box;
|
|
35
|
-
} /* 100px нужны для того, чтобы фон успевал немного затемниться перед тем, как начнет выезжать шторка */ .popup-
|
|
36
|
-
.popup-
|
|
35
|
+
} /* 100px нужны для того, чтобы фон успевал немного затемниться перед тем, как начнет выезжать шторка */ .popup-sheet__appear_idtln,
|
|
36
|
+
.popup-sheet__enter_idtln {
|
|
37
37
|
transform: translateY(calc(100% + 100px));
|
|
38
|
-
} .popup-
|
|
39
|
-
.popup-
|
|
38
|
+
} .popup-sheet__appearActive_idtln,
|
|
39
|
+
.popup-sheet__enterActive_idtln {
|
|
40
40
|
transform: translateY(0);
|
|
41
41
|
transition: transform 300ms cubic-bezier(0.65, 0, 0.35, 1);
|
|
42
42
|
transition-delay: 50ms;
|
|
43
|
-
} .popup-
|
|
43
|
+
} .popup-sheet__exit_idtln {
|
|
44
44
|
transform: translateY(0);
|
|
45
|
-
} .popup-
|
|
45
|
+
} .popup-sheet__exitBySwipe_idtln {
|
|
46
46
|
transform: translateY(calc(100% + 100px));
|
|
47
|
-
} .popup-
|
|
47
|
+
} .popup-sheet__exitActiveBySwipe_idtln {
|
|
48
48
|
transition: none;
|
|
49
|
-
} .popup-
|
|
50
|
-
.popup-
|
|
49
|
+
} .popup-sheet__exitActive_idtln,
|
|
50
|
+
.popup-sheet__exitDone_idtln {
|
|
51
51
|
transform: translateY(calc(100% + 100px));
|
|
52
52
|
transition: transform 300ms cubic-bezier(0.65, 0, 0.35, 1);
|
|
53
53
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
|
|
2
|
+
type WidthUnit = number | string;
|
|
3
|
+
type TextSkeletonProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Кол-во строк текста
|
|
6
|
+
*/
|
|
7
|
+
rows?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Ширина строки
|
|
10
|
+
*/
|
|
11
|
+
width?: WidthUnit | WidthUnit[];
|
|
12
|
+
};
|
|
13
|
+
export { TextElementType, TextSkeletonProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import { TextSkeletonProps } from "./types-1b036d4b";
|
|
5
|
+
type SkeletonProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Флаг, явно задающий состояние, при котором контент закрывается прелоадером
|
|
8
|
+
*/
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Флаг явного включения анимации скелета
|
|
12
|
+
*/
|
|
13
|
+
animate?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Дополнительный класс
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Дополнительные инлайн стили
|
|
20
|
+
*/
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
/**
|
|
23
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
24
|
+
*/
|
|
25
|
+
dataTestId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Дочерние элементы.
|
|
28
|
+
*/
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
};
|
|
31
|
+
declare const Skeleton: React.FC<SkeletonProps>;
|
|
32
|
+
type SkeletonProps$0 = {
|
|
33
|
+
wrapperClassName?: string;
|
|
34
|
+
dataTestId?: string;
|
|
35
|
+
};
|
|
36
|
+
declare function useSkeleton(showSkeleton?: boolean, skeletonProps?: TextSkeletonProps): {
|
|
37
|
+
renderSkeleton: (props: SkeletonProps$0) => React.JSX.Element | null;
|
|
38
|
+
textRef: React.RefObject<HTMLElement>;
|
|
39
|
+
};
|
|
40
|
+
export { SkeletonProps, Skeleton, useSkeleton };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-popup-sheet",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Popup sheet mobile component",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@alfalab/core-components-base-modal": "^5.4.0",
|
|
19
19
|
"@alfalab/core-components-backdrop": "^3.1.0",
|
|
20
|
-
"@alfalab/core-components-shared": "^0.
|
|
21
|
-
"@alfalab/core-components-navigation-bar": "^0.5.
|
|
20
|
+
"@alfalab/core-components-shared": "^0.3.0",
|
|
21
|
+
"@alfalab/core-components-navigation-bar": "^0.5.3",
|
|
22
22
|
"react-swipeable": "^7.0.0",
|
|
23
23
|
"classnames": "^2.3.1",
|
|
24
24
|
"tslib": "^2.4.0"
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type TextElementType = HTMLParagraphElement | HTMLSpanElement | HTMLDivElement;
|
|
2
|
+
type WidthUnit = number | string;
|
|
3
|
+
type TextSkeletonProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Кол-во строк текста
|
|
6
|
+
*/
|
|
7
|
+
rows?: number;
|
|
8
|
+
/**
|
|
9
|
+
* Ширина строки
|
|
10
|
+
*/
|
|
11
|
+
width?: WidthUnit | WidthUnit[];
|
|
12
|
+
};
|
|
13
|
+
export { TextElementType, TextSkeletonProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import { TextSkeletonProps } from "./types-1b036d4b";
|
|
5
|
+
type SkeletonProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Флаг, явно задающий состояние, при котором контент закрывается прелоадером
|
|
8
|
+
*/
|
|
9
|
+
visible?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Флаг явного включения анимации скелета
|
|
12
|
+
*/
|
|
13
|
+
animate?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Дополнительный класс
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Дополнительные инлайн стили
|
|
20
|
+
*/
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
/**
|
|
23
|
+
* Идентификатор для систем автоматизированного тестирования
|
|
24
|
+
*/
|
|
25
|
+
dataTestId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Дочерние элементы.
|
|
28
|
+
*/
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
};
|
|
31
|
+
declare const Skeleton: React.FC<SkeletonProps>;
|
|
32
|
+
type SkeletonProps$0 = {
|
|
33
|
+
wrapperClassName?: string;
|
|
34
|
+
dataTestId?: string;
|
|
35
|
+
};
|
|
36
|
+
declare function useSkeleton(showSkeleton?: boolean, skeletonProps?: TextSkeletonProps): {
|
|
37
|
+
renderSkeleton: (props: SkeletonProps$0) => React.JSX.Element | null;
|
|
38
|
+
textRef: React.RefObject<HTMLElement>;
|
|
39
|
+
};
|
|
40
|
+
export { SkeletonProps, Skeleton, useSkeleton };
|