@alfalab/core-components-confirmation 12.5.3 → 13.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/component.desktop.d.ts +1 -1
- package/component.desktop.js +6 -4
- package/component.mobile.js +7 -5
- package/component.responsive.d.ts +2 -3
- package/component.responsive.js +10 -10
- package/components/base-confirmation/component.js +11 -7
- package/components/base-confirmation/index.css +2 -2
- package/components/base-confirmation/index.js +6 -4
- package/components/countdown-loader/component.js +1 -1
- package/components/countdown-loader/index.css +2 -2
- package/components/header/component.js +1 -1
- package/components/header/index.css +4 -4
- package/components/index.js +6 -4
- package/components/screens/fatal-error/component.js +3 -3
- package/components/screens/fatal-error/index.css +6 -6
- package/components/screens/hint/component.js +3 -3
- package/components/screens/hint/index.css +12 -12
- package/components/screens/index.js +6 -4
- package/components/screens/initial/component.js +23 -11
- package/components/screens/initial/countdown-section.js +2 -2
- package/components/screens/initial/index.css +17 -20
- package/components/screens/initial/index.js +6 -4
- package/components/screens/temp-block/component.js +1 -1
- package/components/screens/temp-block/index.css +7 -7
- package/context.js +2 -0
- package/{countdown-section-751424e6.js → countdown-section-b212c5b4.js} +5 -5
- package/cssm/component.desktop.d.ts +1 -1
- package/cssm/component.desktop.js +5 -3
- package/cssm/component.mobile.js +5 -3
- package/cssm/component.responsive.d.ts +2 -3
- package/cssm/component.responsive.js +9 -9
- package/cssm/components/base-confirmation/component.js +9 -5
- package/cssm/components/base-confirmation/index.js +5 -3
- package/cssm/components/index.js +5 -3
- package/cssm/components/screens/fatal-error/component.js +2 -2
- package/cssm/components/screens/hint/component.js +2 -2
- package/cssm/components/screens/index.js +5 -3
- package/cssm/components/screens/initial/component.js +22 -10
- package/cssm/components/screens/initial/countdown-section.js +4 -4
- package/cssm/components/screens/initial/index.js +5 -3
- package/cssm/components/screens/initial/index.module.css +0 -3
- package/cssm/context.js +2 -0
- package/cssm/desktop.d.ts +1 -1
- package/cssm/desktop.js +8 -4
- package/cssm/index.d.ts +2 -6
- package/cssm/index.js +19 -27
- package/cssm/mobile.d.ts +1 -1
- package/cssm/mobile.js +8 -4
- package/cssm/shared.d.ts +4 -0
- package/cssm/shared.js +43 -0
- package/cssm/types.d.ts +16 -1
- package/desktop.d.ts +1 -1
- package/desktop.js +9 -5
- package/esm/component.desktop.d.ts +1 -1
- package/esm/component.desktop.js +6 -4
- package/esm/component.mobile.js +7 -5
- package/esm/component.responsive.d.ts +2 -3
- package/esm/component.responsive.js +10 -10
- package/esm/components/base-confirmation/component.js +11 -7
- package/esm/components/base-confirmation/index.css +2 -2
- package/esm/components/base-confirmation/index.js +6 -4
- package/esm/components/countdown-loader/component.js +1 -1
- package/esm/components/countdown-loader/index.css +2 -2
- package/esm/components/header/component.js +1 -1
- package/esm/components/header/index.css +4 -4
- package/esm/components/index.js +6 -4
- package/esm/components/screens/fatal-error/component.js +3 -3
- package/esm/components/screens/fatal-error/index.css +6 -6
- package/esm/components/screens/hint/component.js +3 -3
- package/esm/components/screens/hint/index.css +12 -12
- package/esm/components/screens/index.js +6 -4
- package/esm/components/screens/initial/component.js +19 -7
- package/esm/components/screens/initial/countdown-section.js +2 -2
- package/esm/components/screens/initial/index.css +17 -20
- package/esm/components/screens/initial/index.js +6 -4
- package/esm/components/screens/temp-block/component.js +1 -1
- package/esm/components/screens/temp-block/index.css +7 -7
- package/esm/context.js +2 -0
- package/esm/{countdown-section-c4ca26d0.js → countdown-section-83d922ef.js} +5 -5
- package/esm/desktop.d.ts +1 -1
- package/esm/desktop.js +7 -5
- package/esm/index.d.ts +2 -6
- package/esm/index.js +18 -15
- package/esm/mobile.css +2 -2
- package/esm/mobile.d.ts +1 -1
- package/esm/mobile.js +7 -5
- package/esm/shared.d.ts +4 -0
- package/esm/shared.js +20 -0
- package/esm/types.d.ts +16 -1
- package/index.d.ts +2 -6
- package/index.js +17 -25
- package/mobile.css +2 -2
- package/mobile.d.ts +1 -1
- package/mobile.js +9 -5
- package/modern/component.desktop.d.ts +1 -1
- package/modern/component.desktop.js +6 -4
- package/modern/component.mobile.js +7 -5
- package/modern/component.responsive.d.ts +2 -3
- package/modern/component.responsive.js +10 -10
- package/modern/components/base-confirmation/component.js +10 -6
- package/modern/components/base-confirmation/index.css +2 -2
- package/modern/components/base-confirmation/index.js +6 -4
- package/modern/components/countdown-loader/component.js +1 -1
- package/modern/components/countdown-loader/index.css +2 -2
- package/modern/components/header/component.js +1 -1
- package/modern/components/header/index.css +4 -4
- package/modern/components/index.js +6 -4
- package/modern/components/screens/fatal-error/component.js +3 -3
- package/modern/components/screens/fatal-error/index.css +6 -6
- package/modern/components/screens/hint/component.js +3 -3
- package/modern/components/screens/hint/index.css +12 -12
- package/modern/components/screens/index.js +6 -4
- package/modern/components/screens/initial/component.js +19 -7
- package/modern/components/screens/initial/countdown-section.js +2 -2
- package/modern/components/screens/initial/index.css +17 -20
- package/modern/components/screens/initial/index.js +6 -4
- package/modern/components/screens/temp-block/component.js +1 -1
- package/modern/components/screens/temp-block/index.css +7 -7
- package/modern/context.js +2 -0
- package/modern/{countdown-section-473f17f4.js → countdown-section-ea7af879.js} +5 -5
- package/modern/desktop.d.ts +1 -1
- package/modern/desktop.js +7 -5
- package/modern/index.d.ts +2 -6
- package/modern/index.js +18 -15
- package/modern/mobile.css +2 -2
- package/modern/mobile.d.ts +1 -1
- package/modern/mobile.js +7 -5
- package/modern/shared.d.ts +4 -0
- package/modern/shared.js +20 -0
- package/modern/types.d.ts +16 -1
- package/package.json +31 -6
- package/shared.d.ts +4 -0
- package/shared.js +37 -0
- package/src/component.desktop.tsx +10 -0
- package/src/component.mobile.tsx +13 -0
- package/src/component.responsive.tsx +31 -0
- package/src/components/base-confirmation/component.tsx +125 -0
- package/src/components/base-confirmation/index.module.css +8 -0
- package/src/components/base-confirmation/index.ts +1 -0
- package/src/components/countdown-loader/component.tsx +37 -0
- package/src/components/countdown-loader/index.module.css +7 -0
- package/src/components/countdown-loader/index.ts +1 -0
- package/src/components/header/component.tsx +28 -0
- package/src/components/header/index.module.css +21 -0
- package/src/components/header/index.ts +1 -0
- package/src/components/index.ts +2 -0
- package/src/components/screens/fatal-error/component.tsx +46 -0
- package/src/components/screens/fatal-error/index.module.css +23 -0
- package/src/components/screens/fatal-error/index.ts +1 -0
- package/src/components/screens/hint/component.tsx +94 -0
- package/src/components/screens/hint/index.module.css +51 -0
- package/src/components/screens/hint/index.ts +1 -0
- package/src/components/screens/index.ts +4 -0
- package/src/components/screens/initial/component.tsx +203 -0
- package/src/components/screens/initial/countdown-section.tsx +79 -0
- package/src/components/screens/initial/index.module.css +71 -0
- package/src/components/screens/initial/index.ts +1 -0
- package/src/components/screens/temp-block/component.tsx +58 -0
- package/src/components/screens/temp-block/index.module.css +28 -0
- package/src/components/screens/temp-block/index.ts +1 -0
- package/src/context.ts +27 -0
- package/src/desktop.ts +3 -0
- package/src/index.ts +6 -0
- package/src/mobile.module.css +3 -0
- package/src/mobile.ts +3 -0
- package/src/shared.ts +4 -0
- package/src/types.ts +228 -0
- package/src/utils.ts +107 -0
- package/src/vars.css +33 -0
- package/types.d.ts +16 -1
- package/cssm/responsive.d.ts +0 -2
- package/cssm/responsive.js +0 -39
- package/esm/responsive.d.ts +0 -2
- package/esm/responsive.js +0 -23
- package/modern/responsive.d.ts +0 -2
- package/modern/responsive.js +0 -22
- package/responsive.d.ts +0 -2
- package/responsive.js +0 -31
- /package/{countdown-section-751424e6.d.ts → countdown-section-b212c5b4.d.ts} +0 -0
- /package/esm/{countdown-section-c4ca26d0.d.ts → countdown-section-83d922ef.d.ts} +0 -0
- /package/modern/{countdown-section-473f17f4.d.ts → countdown-section-ea7af879.d.ts} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import 'react';
|
|
2
2
|
import 'classnames';
|
|
3
3
|
import '@alfalab/core-components-button/modern';
|
|
4
|
-
import '@alfalab/core-components-
|
|
4
|
+
import '@alfalab/core-components-spinner/modern';
|
|
5
5
|
import '@alfalab/core-components-typography/modern';
|
|
6
6
|
import '../../../context.js';
|
|
7
7
|
import '../../../utils.js';
|
|
8
|
-
export { C as CountdownSection } from '../../../countdown-section-
|
|
8
|
+
export { C as CountdownSection } from '../../../countdown-section-ea7af879.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: l1yvu */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-text-primary: #0e0e0e;
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
/* Hard up */
|
|
15
15
|
} :root {
|
|
16
16
|
} :root {
|
|
17
|
-
--gap-2xs: 4px;
|
|
18
17
|
--gap-s: 12px;
|
|
19
18
|
--gap-m: 16px;
|
|
20
19
|
--gap-l: 20px;
|
|
@@ -38,51 +37,49 @@
|
|
|
38
37
|
--confirmation-text-color: var(--color-light-text-primary)
|
|
39
38
|
|
|
40
39
|
/* header */
|
|
41
|
-
} .
|
|
40
|
+
} .confirmation__component_1yvyt {
|
|
42
41
|
display: flex;
|
|
43
42
|
flex-direction: column;
|
|
44
|
-
} .
|
|
43
|
+
} .confirmation__typographyTheme_1yvyt.confirmation__typographyTheme_1yvyt {
|
|
45
44
|
font-size: var(--confirmation-text-font-size);
|
|
46
45
|
line-height: var(--confirmation-text-line-height);
|
|
47
46
|
font-weight: var(--confirmation-text-font-weight);
|
|
48
47
|
font-family: var(--confirmation-text-font-family);
|
|
49
48
|
color: var(--confirmation-text-color);
|
|
50
|
-
} .
|
|
49
|
+
} .confirmation__phone_1yvyt.confirmation__phone_1yvyt {
|
|
51
50
|
color: var(--color-light-text-primary);
|
|
52
51
|
margin-bottom: var(--gap-2xl);
|
|
53
|
-
} .
|
|
52
|
+
} .confirmation__compact_1yvyt {
|
|
54
53
|
margin-bottom: var(--gap-xl);
|
|
55
|
-
} .
|
|
54
|
+
} .confirmation__loaderWrap_1yvyt {
|
|
56
55
|
display: flex;
|
|
57
56
|
align-items: center;
|
|
58
|
-
} .
|
|
57
|
+
} .confirmation__left_1yvyt {
|
|
59
58
|
align-items: flex-start;
|
|
60
|
-
} .
|
|
59
|
+
} .confirmation__center_1yvyt {
|
|
61
60
|
align-items: center;
|
|
62
61
|
text-align: center
|
|
63
|
-
} .
|
|
62
|
+
} .confirmation__center_1yvyt .confirmation__loaderWrap_1yvyt {
|
|
64
63
|
justify-content: center;
|
|
65
|
-
} .
|
|
66
|
-
margin: 0 var(--gap-2xs);
|
|
67
|
-
} .confirmation__codeInput_szvne {
|
|
64
|
+
} .confirmation__codeInput_1yvyt {
|
|
68
65
|
margin-bottom: var(--gap-s);
|
|
69
|
-
} .
|
|
66
|
+
} .confirmation__smsComeLink_1yvyt.confirmation__smsComeLink_1yvyt {
|
|
70
67
|
font-size: 14px;
|
|
71
68
|
line-height: 20px;
|
|
72
69
|
font-weight: 500;
|
|
73
|
-
} .
|
|
70
|
+
} .confirmation__countdownContainer_1yvyt.confirmation__countdownContainer_1yvyt {
|
|
74
71
|
color: var(--color-light-text-secondary);
|
|
75
72
|
margin-bottom: var(--gap-xl);
|
|
76
|
-
} .
|
|
73
|
+
} .confirmation__countdownMobile_1yvyt.confirmation__countdownMobile_1yvyt {
|
|
77
74
|
margin-bottom: var(--gap-l);
|
|
78
|
-
} .
|
|
75
|
+
} .confirmation__countdownLoaderMobile_1yvyt.confirmation__countdownLoaderMobile_1yvyt {
|
|
79
76
|
margin-bottom: var(--gap-m);
|
|
80
|
-
} .
|
|
77
|
+
} .confirmation__getCodeButton_1yvyt {
|
|
81
78
|
position: relative;
|
|
82
79
|
top: var(--gap-2xs-neg);
|
|
83
80
|
margin-bottom: var(--gap-m);
|
|
84
|
-
} .
|
|
81
|
+
} .confirmation__getCodeButtonMobile_1yvyt {
|
|
85
82
|
margin-bottom: 0;
|
|
86
|
-
} .
|
|
83
|
+
} .confirmation__containerInput_1yvyt {
|
|
87
84
|
min-height: 80px;
|
|
88
85
|
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
export { Initial } from './component.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'classnames';
|
|
4
|
-
import '@alfalab/core-components-button/modern';
|
|
5
|
-
import '@alfalab/core-components-code-input/modern';
|
|
4
|
+
import '@alfalab/core-components-button/modern/mobile';
|
|
5
|
+
import '@alfalab/core-components-code-input/modern/desktop';
|
|
6
|
+
import '@alfalab/core-components-code-input/modern/mobile';
|
|
6
7
|
import '@alfalab/core-components-link/modern';
|
|
7
8
|
import '@alfalab/core-components-typography/modern';
|
|
8
9
|
import '@alfalab/hooks';
|
|
9
10
|
import '../../../context.js';
|
|
10
11
|
import '../../../utils.js';
|
|
11
12
|
import '../../header/component.js';
|
|
12
|
-
import '../../../countdown-section-
|
|
13
|
-
import '@alfalab/core-components-
|
|
13
|
+
import '../../../countdown-section-ea7af879.js';
|
|
14
|
+
import '@alfalab/core-components-button/modern';
|
|
15
|
+
import '@alfalab/core-components-spinner/modern';
|
|
@@ -6,7 +6,7 @@ import { useCountdown, formatMsAsMinutes } from '../../../utils.js';
|
|
|
6
6
|
import { CountdownLoader } from '../../countdown-loader/component.js';
|
|
7
7
|
import { Header } from '../../header/component.js';
|
|
8
8
|
|
|
9
|
-
const styles = {"component":"
|
|
9
|
+
const styles = {"component":"confirmation__component_164iy","center":"confirmation__center_164iy","typographyTheme":"confirmation__typographyTheme_164iy","description":"confirmation__description_164iy","countdownWrap":"confirmation__countdownWrap_164iy","loader":"confirmation__loader_164iy"};
|
|
10
10
|
require('./index.css')
|
|
11
11
|
|
|
12
12
|
const TempBlock = ({ mobile }) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1ce4x */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-text-primary: #0e0e0e; /* 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 */
|
|
@@ -31,23 +31,23 @@
|
|
|
31
31
|
--confirmation-text-color: var(--color-light-text-primary)
|
|
32
32
|
|
|
33
33
|
/* header */
|
|
34
|
-
} .
|
|
34
|
+
} .confirmation__component_164iy {
|
|
35
35
|
display: flex;
|
|
36
36
|
flex-direction: column;
|
|
37
|
-
} .
|
|
37
|
+
} .confirmation__center_164iy {
|
|
38
38
|
align-items: center;
|
|
39
39
|
text-align: center;
|
|
40
|
-
} .
|
|
40
|
+
} .confirmation__typographyTheme_164iy.confirmation__typographyTheme_164iy {
|
|
41
41
|
font-size: var(--confirmation-text-font-size);
|
|
42
42
|
line-height: var(--confirmation-text-line-height);
|
|
43
43
|
font-weight: var(--confirmation-text-font-weight);
|
|
44
44
|
font-family: var(--confirmation-text-font-family);
|
|
45
45
|
color: var(--confirmation-text-color);
|
|
46
|
-
} .
|
|
46
|
+
} .confirmation__description_164iy.confirmation__description_164iy {
|
|
47
47
|
margin-bottom: var(--gap-xs);
|
|
48
|
-
} .
|
|
48
|
+
} .confirmation__countdownWrap_164iy {
|
|
49
49
|
display: flex;
|
|
50
50
|
align-items: center;
|
|
51
|
-
} .
|
|
51
|
+
} .confirmation__loader_164iy {
|
|
52
52
|
margin-right: var(--gap-xs);
|
|
53
53
|
}
|
package/modern/context.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React, { useContext } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Button } from '@alfalab/core-components-button/modern';
|
|
4
|
-
import {
|
|
4
|
+
import { Spinner } from '@alfalab/core-components-spinner/modern';
|
|
5
5
|
import { Typography } from '@alfalab/core-components-typography/modern';
|
|
6
6
|
import { ConfirmationContext } from './context.js';
|
|
7
7
|
import { formatMsAsMinutes } from './utils.js';
|
|
8
8
|
|
|
9
|
-
const styles = {"component":"
|
|
9
|
+
const styles = {"component":"confirmation__component_1yvyt","typographyTheme":"confirmation__typographyTheme_1yvyt","phone":"confirmation__phone_1yvyt","compact":"confirmation__compact_1yvyt","loaderWrap":"confirmation__loaderWrap_1yvyt","left":"confirmation__left_1yvyt","center":"confirmation__center_1yvyt","codeInput":"confirmation__codeInput_1yvyt","smsComeLink":"confirmation__smsComeLink_1yvyt","countdownContainer":"confirmation__countdownContainer_1yvyt","countdownMobile":"confirmation__countdownMobile_1yvyt","countdownLoaderMobile":"confirmation__countdownLoaderMobile_1yvyt","getCodeButton":"confirmation__getCodeButton_1yvyt","getCodeButtonMobile":"confirmation__getCodeButtonMobile_1yvyt","containerInput":"confirmation__containerInput_1yvyt"};
|
|
10
10
|
require('./components/screens/initial/index.css')
|
|
11
11
|
|
|
12
12
|
const CountdownSection = ({ codeSendHintVisible, timePassed, processing, mobile, handleSmsRetryClick, }) => {
|
|
13
|
-
const { state, texts, timeLeft, blockSmsRetry } = useContext(ConfirmationContext);
|
|
13
|
+
const { state, texts, timeLeft, blockSmsRetry, breakpoint } = useContext(ConfirmationContext);
|
|
14
14
|
const renderText = (text) => (React.createElement(Typography.Text, { className: cn(styles.countdownContainer, {
|
|
15
15
|
[styles.countdownMobile]: mobile,
|
|
16
16
|
[styles.typographyTheme]: !mobile,
|
|
@@ -22,13 +22,13 @@ const CountdownSection = ({ codeSendHintVisible, timePassed, processing, mobile,
|
|
|
22
22
|
[styles.countdownLoaderMobile]: mobile,
|
|
23
23
|
[styles.typographyTheme]: !mobile,
|
|
24
24
|
}) },
|
|
25
|
-
React.createElement(
|
|
25
|
+
React.createElement(Spinner, { visible: true }),
|
|
26
26
|
React.createElement("span", { className: styles.loaderText }, state === 'CODE_CHECKING' ? texts.codeChecking : texts.codeSending)));
|
|
27
27
|
}
|
|
28
28
|
if (blockSmsRetry)
|
|
29
29
|
return renderText(texts.noAttemptsLeft);
|
|
30
30
|
if (timePassed) {
|
|
31
|
-
return (React.createElement(Button, { size: mobile ? 'xs' : 'xxs', view: 'secondary', onClick: handleSmsRetryClick, className: cn(styles.getCodeButton, { [styles.getCodeButtonMobile]: mobile }) }, texts.buttonRetry));
|
|
31
|
+
return (React.createElement(Button, { size: mobile ? 'xs' : 'xxs', view: 'secondary', onClick: handleSmsRetryClick, className: cn(styles.getCodeButton, { [styles.getCodeButtonMobile]: mobile }), breakpoint: breakpoint }, texts.buttonRetry));
|
|
32
32
|
}
|
|
33
33
|
return renderText(`${texts.countdown} ${formatMsAsMinutes(timeLeft)}`);
|
|
34
34
|
};
|
package/modern/desktop.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./component.desktop";
|
|
2
|
-
export {};
|
|
2
|
+
export { useConfirmation, useCountdown } from "./utils";
|
package/modern/desktop.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
export { ConfirmationDesktop } from './component.desktop.js';
|
|
2
|
+
export { useConfirmation, useCountdown } from './utils.js';
|
|
2
3
|
import 'react';
|
|
3
4
|
import './components/base-confirmation/component.js';
|
|
4
5
|
import 'classnames';
|
|
5
6
|
import '@alfalab/hooks';
|
|
6
7
|
import './context.js';
|
|
7
|
-
import './utils.js';
|
|
8
8
|
import './types.js';
|
|
9
9
|
import './components/screens/initial/component.js';
|
|
10
|
-
import '@alfalab/core-components-button/modern';
|
|
11
|
-
import '@alfalab/core-components-code-input/modern';
|
|
10
|
+
import '@alfalab/core-components-button/modern/mobile';
|
|
11
|
+
import '@alfalab/core-components-code-input/modern/desktop';
|
|
12
|
+
import '@alfalab/core-components-code-input/modern/mobile';
|
|
12
13
|
import '@alfalab/core-components-link/modern';
|
|
13
14
|
import '@alfalab/core-components-typography/modern';
|
|
14
15
|
import './components/header/component.js';
|
|
15
|
-
import './countdown-section-
|
|
16
|
-
import '@alfalab/core-components-
|
|
16
|
+
import './countdown-section-ea7af879.js';
|
|
17
|
+
import '@alfalab/core-components-button/modern';
|
|
18
|
+
import '@alfalab/core-components-spinner/modern';
|
|
17
19
|
import './components/screens/hint/component.js';
|
|
18
20
|
import './components/screens/fatal-error/component.js';
|
|
19
21
|
import './components/screens/temp-block/component.js';
|
package/modern/index.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export
|
|
3
|
-
export * from "./components/index";
|
|
4
|
-
export * from "./context";
|
|
5
|
-
export * from "./types";
|
|
6
|
-
export * from "./utils";
|
|
1
|
+
export { ConfirmationResponsive as Confirmation, ResponsiveConfirmationProps as ConfirmationProps } from "./component.responsive";
|
|
2
|
+
export { useConfirmation, useCountdown } from "./utils";
|
package/modern/index.js
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export { Initial } from './components/screens/initial/component.js';
|
|
4
|
-
export { Hint } from './components/screens/hint/component.js';
|
|
5
|
-
export { FatalError } from './components/screens/fatal-error/component.js';
|
|
6
|
-
export { TempBlock } from './components/screens/temp-block/component.js';
|
|
7
|
-
export { CountdownLoader } from './components/countdown-loader/component.js';
|
|
8
|
-
export { ConfirmationContext } from './context.js';
|
|
9
|
-
export { defaultTexts } from './types.js';
|
|
10
|
-
export { ONE_DAY, ONE_MINUTE, formatMsAsMinutes, useConfirmation, useCountdown } from './utils.js';
|
|
1
|
+
export { ConfirmationResponsive as Confirmation } from './component.responsive.js';
|
|
2
|
+
export { useConfirmation, useCountdown } from './utils.js';
|
|
11
3
|
import 'react';
|
|
4
|
+
import '@alfalab/core-components-mq/modern';
|
|
5
|
+
import './component.desktop.js';
|
|
12
6
|
import './components/base-confirmation/component.js';
|
|
13
7
|
import 'classnames';
|
|
14
8
|
import '@alfalab/hooks';
|
|
15
|
-
import './
|
|
16
|
-
import '
|
|
17
|
-
import '
|
|
9
|
+
import './context.js';
|
|
10
|
+
import './types.js';
|
|
11
|
+
import './components/screens/initial/component.js';
|
|
12
|
+
import '@alfalab/core-components-button/modern/mobile';
|
|
13
|
+
import '@alfalab/core-components-code-input/modern/desktop';
|
|
14
|
+
import '@alfalab/core-components-code-input/modern/mobile';
|
|
18
15
|
import '@alfalab/core-components-link/modern';
|
|
19
16
|
import '@alfalab/core-components-typography/modern';
|
|
20
17
|
import './components/header/component.js';
|
|
21
|
-
import './countdown-section-
|
|
22
|
-
import '@alfalab/core-components-
|
|
18
|
+
import './countdown-section-ea7af879.js';
|
|
19
|
+
import '@alfalab/core-components-button/modern';
|
|
20
|
+
import '@alfalab/core-components-spinner/modern';
|
|
21
|
+
import './components/screens/hint/component.js';
|
|
22
|
+
import './components/screens/fatal-error/component.js';
|
|
23
|
+
import './components/screens/temp-block/component.js';
|
|
24
|
+
import './components/countdown-loader/component.js';
|
|
25
|
+
import './component.mobile.js';
|
package/modern/mobile.css
CHANGED
package/modern/mobile.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./component.mobile";
|
|
2
|
-
export {};
|
|
2
|
+
export { useConfirmation, useCountdown } from "./utils";
|
package/modern/mobile.js
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
export { ConfirmationMobile } from './component.mobile.js';
|
|
2
|
+
export { useConfirmation, useCountdown } from './utils.js';
|
|
2
3
|
import 'react';
|
|
3
4
|
import 'classnames';
|
|
4
5
|
import './components/base-confirmation/component.js';
|
|
5
6
|
import '@alfalab/hooks';
|
|
6
7
|
import './context.js';
|
|
7
|
-
import './utils.js';
|
|
8
8
|
import './types.js';
|
|
9
9
|
import './components/screens/initial/component.js';
|
|
10
|
-
import '@alfalab/core-components-button/modern';
|
|
11
|
-
import '@alfalab/core-components-code-input/modern';
|
|
10
|
+
import '@alfalab/core-components-button/modern/mobile';
|
|
11
|
+
import '@alfalab/core-components-code-input/modern/desktop';
|
|
12
|
+
import '@alfalab/core-components-code-input/modern/mobile';
|
|
12
13
|
import '@alfalab/core-components-link/modern';
|
|
13
14
|
import '@alfalab/core-components-typography/modern';
|
|
14
15
|
import './components/header/component.js';
|
|
15
|
-
import './countdown-section-
|
|
16
|
-
import '@alfalab/core-components-
|
|
16
|
+
import './countdown-section-ea7af879.js';
|
|
17
|
+
import '@alfalab/core-components-button/modern';
|
|
18
|
+
import '@alfalab/core-components-spinner/modern';
|
|
17
19
|
import './components/screens/hint/component.js';
|
|
18
20
|
import './components/screens/fatal-error/component.js';
|
|
19
21
|
import './components/screens/temp-block/component.js';
|
package/modern/shared.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export { Initial } from './components/screens/initial/component.js';
|
|
2
|
+
export { Hint } from './components/screens/hint/component.js';
|
|
3
|
+
export { FatalError } from './components/screens/fatal-error/component.js';
|
|
4
|
+
export { TempBlock } from './components/screens/temp-block/component.js';
|
|
5
|
+
export { CountdownLoader } from './components/countdown-loader/component.js';
|
|
6
|
+
export { ConfirmationContext } from './context.js';
|
|
7
|
+
export { defaultTexts } from './types.js';
|
|
8
|
+
export { ONE_DAY, ONE_MINUTE, formatMsAsMinutes } from './utils.js';
|
|
9
|
+
import 'react';
|
|
10
|
+
import 'classnames';
|
|
11
|
+
import '@alfalab/core-components-button/modern/mobile';
|
|
12
|
+
import '@alfalab/core-components-code-input/modern/desktop';
|
|
13
|
+
import '@alfalab/core-components-code-input/modern/mobile';
|
|
14
|
+
import '@alfalab/core-components-link/modern';
|
|
15
|
+
import '@alfalab/core-components-typography/modern';
|
|
16
|
+
import '@alfalab/hooks';
|
|
17
|
+
import './components/header/component.js';
|
|
18
|
+
import './countdown-section-ea7af879.js';
|
|
19
|
+
import '@alfalab/core-components-button/modern';
|
|
20
|
+
import '@alfalab/core-components-spinner/modern';
|
package/modern/types.d.ts
CHANGED
|
@@ -89,9 +89,24 @@ type ConfirmationProps = {
|
|
|
89
89
|
* @default false
|
|
90
90
|
*/
|
|
91
91
|
hideCountdownSection?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Слот для контента с подсказкой на главном экране
|
|
94
|
+
*/
|
|
95
|
+
initialScreenHintSlot?: ReactNode;
|
|
96
|
+
/**
|
|
97
|
+
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
98
|
+
* @default 1024
|
|
99
|
+
*/
|
|
100
|
+
breakpoint?: number;
|
|
92
101
|
};
|
|
93
|
-
type TConfirmationContext = Required<Pick<ConfirmationProps, 'alignContent' | 'texts' | 'state' | 'screen' | 'requiredCharAmount' | 'onInputFinished' | 'countdownDuration' | 'onChangeState' | 'onSmsRetryClick' | 'onChangeScreen' | 'onFatalErrorOkButtonClick' | 'tempBlockDuration' | 'hideCountdownSection'>> & Pick<ConfirmationProps, 'phone' | 'blockSmsRetry' | 'onTempBlockFinished' | 'clearCodeOnError'> & {
|
|
102
|
+
type TConfirmationContext = Required<Pick<ConfirmationProps, 'alignContent' | 'texts' | 'state' | 'screen' | 'requiredCharAmount' | 'onInputFinished' | 'countdownDuration' | 'onChangeState' | 'onSmsRetryClick' | 'onChangeScreen' | 'onFatalErrorOkButtonClick' | 'tempBlockDuration' | 'hideCountdownSection'>> & Pick<ConfirmationProps, 'phone' | 'blockSmsRetry' | 'onTempBlockFinished' | 'clearCodeOnError' | 'initialScreenHintSlot'> & {
|
|
94
103
|
timeLeft: number;
|
|
104
|
+
} & {
|
|
105
|
+
/**
|
|
106
|
+
* Контрольная точка для кнопки, с нее начинается desktop версия
|
|
107
|
+
* @default 1024
|
|
108
|
+
*/
|
|
109
|
+
breakpoint?: number;
|
|
95
110
|
};
|
|
96
111
|
type ConfirmationTexts = {
|
|
97
112
|
/**
|
package/package.json
CHANGED
|
@@ -1,21 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfalab/core-components-confirmation",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.1.0",
|
|
4
4
|
"description": "Sms confirmation component",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"module": "./esm/index.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./esm/index.js",
|
|
12
|
+
"require": "./index.js"
|
|
13
|
+
},
|
|
14
|
+
"./mobile": {
|
|
15
|
+
"import": "./esm/mobile.js",
|
|
16
|
+
"require": "./mobile.js"
|
|
17
|
+
},
|
|
18
|
+
"./desktop": {
|
|
19
|
+
"import": "./esm/desktop.js",
|
|
20
|
+
"require": "./desktop.js"
|
|
21
|
+
},
|
|
22
|
+
"./shared": {
|
|
23
|
+
"import": "./esm/shared.js",
|
|
24
|
+
"require": "./shared.js"
|
|
25
|
+
},
|
|
26
|
+
"./esm": "./esm/index.js",
|
|
27
|
+
"./cssm": "./cssm/index.js",
|
|
28
|
+
"./modern": "./modern/index.js",
|
|
29
|
+
"./esm/*": "./esm/*",
|
|
30
|
+
"./cssm/*": "./cssm/*",
|
|
31
|
+
"./modern/*": "./modern/*"
|
|
32
|
+
},
|
|
9
33
|
"publishConfig": {
|
|
10
34
|
"access": "public",
|
|
11
35
|
"directory": "dist"
|
|
12
36
|
},
|
|
13
37
|
"dependencies": {
|
|
14
|
-
"@alfalab/core-components-button": "^
|
|
15
|
-
"@alfalab/core-components-code-input": "^
|
|
16
|
-
"@alfalab/core-components-link": "^5.0
|
|
17
|
-
"@alfalab/core-components-
|
|
18
|
-
"@alfalab/core-components-typography": "^
|
|
38
|
+
"@alfalab/core-components-button": "^9.0.1",
|
|
39
|
+
"@alfalab/core-components-code-input": "^3.0.0",
|
|
40
|
+
"@alfalab/core-components-link": "^5.1.0",
|
|
41
|
+
"@alfalab/core-components-spinner": "^3.1.0",
|
|
42
|
+
"@alfalab/core-components-typography": "^4.0.0",
|
|
43
|
+
"@alfalab/core-components-mq": "^4.2.0",
|
|
19
44
|
"@alfalab/hooks": "^1.13.0",
|
|
20
45
|
"classnames": "^2.3.1",
|
|
21
46
|
"tslib": "^2.4.0"
|
package/shared.d.ts
ADDED
package/shared.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var components_screens_initial_component = require('./components/screens/initial/component.js');
|
|
6
|
+
var components_screens_hint_component = require('./components/screens/hint/component.js');
|
|
7
|
+
var components_screens_fatalError_component = require('./components/screens/fatal-error/component.js');
|
|
8
|
+
var components_screens_tempBlock_component = require('./components/screens/temp-block/component.js');
|
|
9
|
+
var components_countdownLoader_component = require('./components/countdown-loader/component.js');
|
|
10
|
+
var context = require('./context.js');
|
|
11
|
+
var types = require('./types.js');
|
|
12
|
+
var utils = require('./utils.js');
|
|
13
|
+
require('react');
|
|
14
|
+
require('classnames');
|
|
15
|
+
require('@alfalab/core-components-button/mobile');
|
|
16
|
+
require('@alfalab/core-components-code-input/desktop');
|
|
17
|
+
require('@alfalab/core-components-code-input/mobile');
|
|
18
|
+
require('@alfalab/core-components-link');
|
|
19
|
+
require('@alfalab/core-components-typography');
|
|
20
|
+
require('@alfalab/hooks');
|
|
21
|
+
require('./components/header/component.js');
|
|
22
|
+
require('./countdown-section-b212c5b4.js');
|
|
23
|
+
require('@alfalab/core-components-button');
|
|
24
|
+
require('@alfalab/core-components-spinner');
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
exports.Initial = components_screens_initial_component.Initial;
|
|
29
|
+
exports.Hint = components_screens_hint_component.Hint;
|
|
30
|
+
exports.FatalError = components_screens_fatalError_component.FatalError;
|
|
31
|
+
exports.TempBlock = components_screens_tempBlock_component.TempBlock;
|
|
32
|
+
exports.CountdownLoader = components_countdownLoader_component.CountdownLoader;
|
|
33
|
+
exports.ConfirmationContext = context.ConfirmationContext;
|
|
34
|
+
exports.defaultTexts = types.defaultTexts;
|
|
35
|
+
exports.ONE_DAY = utils.ONE_DAY;
|
|
36
|
+
exports.ONE_MINUTE = utils.ONE_MINUTE;
|
|
37
|
+
exports.formatMsAsMinutes = utils.formatMsAsMinutes;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
import { BaseConfirmation } from './components/base-confirmation';
|
|
4
|
+
import { ConfirmationProps } from './types';
|
|
5
|
+
|
|
6
|
+
export type DesktopConfirmationProps = Omit<ConfirmationProps, 'mobile' | 'breakpoint'>;
|
|
7
|
+
|
|
8
|
+
export const ConfirmationDesktop: FC<DesktopConfirmationProps> = (props) => (
|
|
9
|
+
<BaseConfirmation {...props} />
|
|
10
|
+
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
|
|
4
|
+
import { BaseConfirmation } from './components/base-confirmation';
|
|
5
|
+
import { ConfirmationProps } from './types';
|
|
6
|
+
|
|
7
|
+
import styles from './mobile.module.css';
|
|
8
|
+
|
|
9
|
+
export type MobileConfirmationProps = Omit<ConfirmationProps, 'mobile'>;
|
|
10
|
+
|
|
11
|
+
export const ConfirmationMobile: FC<MobileConfirmationProps> = ({ className, ...resProps }) => (
|
|
12
|
+
<BaseConfirmation mobile={true} className={cn(className, styles.container)} {...resProps} />
|
|
13
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
import { useMatchMedia } from '@alfalab/core-components-mq';
|
|
4
|
+
|
|
5
|
+
import { ConfirmationDesktop } from './component.desktop';
|
|
6
|
+
import { ConfirmationMobile } from './component.mobile';
|
|
7
|
+
import { ConfirmationProps } from './types';
|
|
8
|
+
|
|
9
|
+
export type ResponsiveConfirmationProps = Omit<
|
|
10
|
+
ConfirmationProps,
|
|
11
|
+
'confirmationScreens' | 'breakpoint'
|
|
12
|
+
> & {
|
|
13
|
+
/**
|
|
14
|
+
* Контрольная точка, с нее начинается desktop версия
|
|
15
|
+
* @default 1024
|
|
16
|
+
*/
|
|
17
|
+
breakpoint?: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const ConfirmationResponsive: FC<ResponsiveConfirmationProps> = ({
|
|
21
|
+
breakpoint = 1024,
|
|
22
|
+
...restProps
|
|
23
|
+
}) => {
|
|
24
|
+
const [isDesktop] = useMatchMedia(`(min-width: ${breakpoint}px)`, true);
|
|
25
|
+
|
|
26
|
+
return isDesktop ? (
|
|
27
|
+
<ConfirmationDesktop {...restProps} />
|
|
28
|
+
) : (
|
|
29
|
+
<ConfirmationMobile breakpoint={breakpoint} {...restProps} />
|
|
30
|
+
);
|
|
31
|
+
};
|