@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
package/index.js
CHANGED
|
@@ -2,43 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var component_desktop = require('./component.desktop.js');
|
|
6
5
|
var component_responsive = require('./component.responsive.js');
|
|
7
|
-
var components_screens_initial_component = require('./components/screens/initial/component.js');
|
|
8
|
-
var components_screens_hint_component = require('./components/screens/hint/component.js');
|
|
9
|
-
var components_screens_fatalError_component = require('./components/screens/fatal-error/component.js');
|
|
10
|
-
var components_screens_tempBlock_component = require('./components/screens/temp-block/component.js');
|
|
11
|
-
var components_countdownLoader_component = require('./components/countdown-loader/component.js');
|
|
12
|
-
var context = require('./context.js');
|
|
13
|
-
var types = require('./types.js');
|
|
14
6
|
var utils = require('./utils.js');
|
|
15
7
|
require('tslib');
|
|
16
8
|
require('react');
|
|
9
|
+
require('@alfalab/core-components-mq');
|
|
10
|
+
require('./component.desktop.js');
|
|
17
11
|
require('./components/base-confirmation/component.js');
|
|
18
12
|
require('classnames');
|
|
19
13
|
require('@alfalab/hooks');
|
|
20
|
-
require('./
|
|
21
|
-
require('
|
|
22
|
-
require('
|
|
14
|
+
require('./context.js');
|
|
15
|
+
require('./types.js');
|
|
16
|
+
require('./components/screens/initial/component.js');
|
|
17
|
+
require('@alfalab/core-components-button/mobile');
|
|
18
|
+
require('@alfalab/core-components-code-input/desktop');
|
|
19
|
+
require('@alfalab/core-components-code-input/mobile');
|
|
23
20
|
require('@alfalab/core-components-link');
|
|
24
21
|
require('@alfalab/core-components-typography');
|
|
25
22
|
require('./components/header/component.js');
|
|
26
|
-
require('./countdown-section-
|
|
27
|
-
require('@alfalab/core-components-
|
|
23
|
+
require('./countdown-section-b212c5b4.js');
|
|
24
|
+
require('@alfalab/core-components-button');
|
|
25
|
+
require('@alfalab/core-components-spinner');
|
|
26
|
+
require('./components/screens/hint/component.js');
|
|
27
|
+
require('./components/screens/fatal-error/component.js');
|
|
28
|
+
require('./components/screens/temp-block/component.js');
|
|
29
|
+
require('./components/countdown-loader/component.js');
|
|
30
|
+
require('./component.mobile.js');
|
|
28
31
|
|
|
29
32
|
|
|
30
33
|
|
|
31
|
-
exports.Confirmation =
|
|
32
|
-
exports.ConfirmationResponsive = component_responsive.ConfirmationResponsive;
|
|
33
|
-
exports.Initial = components_screens_initial_component.Initial;
|
|
34
|
-
exports.Hint = components_screens_hint_component.Hint;
|
|
35
|
-
exports.FatalError = components_screens_fatalError_component.FatalError;
|
|
36
|
-
exports.TempBlock = components_screens_tempBlock_component.TempBlock;
|
|
37
|
-
exports.CountdownLoader = components_countdownLoader_component.CountdownLoader;
|
|
38
|
-
exports.ConfirmationContext = context.ConfirmationContext;
|
|
39
|
-
exports.defaultTexts = types.defaultTexts;
|
|
40
|
-
exports.ONE_DAY = utils.ONE_DAY;
|
|
41
|
-
exports.ONE_MINUTE = utils.ONE_MINUTE;
|
|
42
|
-
exports.formatMsAsMinutes = utils.formatMsAsMinutes;
|
|
34
|
+
exports.Confirmation = component_responsive.ConfirmationResponsive;
|
|
43
35
|
exports.useConfirmation = utils.useConfirmation;
|
|
44
36
|
exports.useCountdown = utils.useCountdown;
|
package/mobile.css
CHANGED
package/mobile.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./component.mobile";
|
|
2
|
-
export {};
|
|
2
|
+
export { useConfirmation, useCountdown } from "./utils";
|
package/mobile.js
CHANGED
|
@@ -3,22 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var component_mobile = require('./component.mobile.js');
|
|
6
|
+
var utils = require('./utils.js');
|
|
6
7
|
require('tslib');
|
|
7
8
|
require('react');
|
|
8
9
|
require('classnames');
|
|
9
10
|
require('./components/base-confirmation/component.js');
|
|
10
11
|
require('@alfalab/hooks');
|
|
11
12
|
require('./context.js');
|
|
12
|
-
require('./utils.js');
|
|
13
13
|
require('./types.js');
|
|
14
14
|
require('./components/screens/initial/component.js');
|
|
15
|
-
require('@alfalab/core-components-button');
|
|
16
|
-
require('@alfalab/core-components-code-input');
|
|
15
|
+
require('@alfalab/core-components-button/mobile');
|
|
16
|
+
require('@alfalab/core-components-code-input/desktop');
|
|
17
|
+
require('@alfalab/core-components-code-input/mobile');
|
|
17
18
|
require('@alfalab/core-components-link');
|
|
18
19
|
require('@alfalab/core-components-typography');
|
|
19
20
|
require('./components/header/component.js');
|
|
20
|
-
require('./countdown-section-
|
|
21
|
-
require('@alfalab/core-components-
|
|
21
|
+
require('./countdown-section-b212c5b4.js');
|
|
22
|
+
require('@alfalab/core-components-button');
|
|
23
|
+
require('@alfalab/core-components-spinner');
|
|
22
24
|
require('./components/screens/hint/component.js');
|
|
23
25
|
require('./components/screens/fatal-error/component.js');
|
|
24
26
|
require('./components/screens/temp-block/component.js');
|
|
@@ -27,3 +29,5 @@ require('./components/countdown-loader/component.js');
|
|
|
27
29
|
|
|
28
30
|
|
|
29
31
|
exports.ConfirmationMobile = component_mobile.ConfirmationMobile;
|
|
32
|
+
exports.useConfirmation = utils.useConfirmation;
|
|
33
|
+
exports.useCountdown = utils.useCountdown;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { ConfirmationProps } from "./types";
|
|
3
|
-
type DesktopConfirmationProps = Omit<ConfirmationProps, 'mobile'>;
|
|
3
|
+
type DesktopConfirmationProps = Omit<ConfirmationProps, 'mobile' | 'breakpoint'>;
|
|
4
4
|
declare const ConfirmationDesktop: FC<DesktopConfirmationProps>;
|
|
5
5
|
export { DesktopConfirmationProps, ConfirmationDesktop };
|
|
@@ -6,13 +6,15 @@ import './context.js';
|
|
|
6
6
|
import './utils.js';
|
|
7
7
|
import './types.js';
|
|
8
8
|
import './components/screens/initial/component.js';
|
|
9
|
-
import '@alfalab/core-components-button/modern';
|
|
10
|
-
import '@alfalab/core-components-code-input/modern';
|
|
9
|
+
import '@alfalab/core-components-button/modern/mobile';
|
|
10
|
+
import '@alfalab/core-components-code-input/modern/desktop';
|
|
11
|
+
import '@alfalab/core-components-code-input/modern/mobile';
|
|
11
12
|
import '@alfalab/core-components-link/modern';
|
|
12
13
|
import '@alfalab/core-components-typography/modern';
|
|
13
14
|
import './components/header/component.js';
|
|
14
|
-
import './countdown-section-
|
|
15
|
-
import '@alfalab/core-components-
|
|
15
|
+
import './countdown-section-ea7af879.js';
|
|
16
|
+
import '@alfalab/core-components-button/modern';
|
|
17
|
+
import '@alfalab/core-components-spinner/modern';
|
|
16
18
|
import './components/screens/hint/component.js';
|
|
17
19
|
import './components/screens/fatal-error/component.js';
|
|
18
20
|
import './components/screens/temp-block/component.js';
|
|
@@ -6,19 +6,21 @@ import './context.js';
|
|
|
6
6
|
import './utils.js';
|
|
7
7
|
import './types.js';
|
|
8
8
|
import './components/screens/initial/component.js';
|
|
9
|
-
import '@alfalab/core-components-button/modern';
|
|
10
|
-
import '@alfalab/core-components-code-input/modern';
|
|
9
|
+
import '@alfalab/core-components-button/modern/mobile';
|
|
10
|
+
import '@alfalab/core-components-code-input/modern/desktop';
|
|
11
|
+
import '@alfalab/core-components-code-input/modern/mobile';
|
|
11
12
|
import '@alfalab/core-components-link/modern';
|
|
12
13
|
import '@alfalab/core-components-typography/modern';
|
|
13
14
|
import './components/header/component.js';
|
|
14
|
-
import './countdown-section-
|
|
15
|
-
import '@alfalab/core-components-
|
|
15
|
+
import './countdown-section-ea7af879.js';
|
|
16
|
+
import '@alfalab/core-components-button/modern';
|
|
17
|
+
import '@alfalab/core-components-spinner/modern';
|
|
16
18
|
import './components/screens/hint/component.js';
|
|
17
19
|
import './components/screens/fatal-error/component.js';
|
|
18
20
|
import './components/screens/temp-block/component.js';
|
|
19
21
|
import './components/countdown-loader/component.js';
|
|
20
22
|
|
|
21
|
-
const styles = {"container":"
|
|
23
|
+
const styles = {"container":"confirmation__container_bsppw"};
|
|
22
24
|
require('./mobile.css')
|
|
23
25
|
|
|
24
26
|
const ConfirmationMobile = ({ className, ...resProps }) => (React.createElement(BaseConfirmation, { mobile: true, className: cn(className, styles.container), ...resProps }));
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { ConfirmationProps } from "./types";
|
|
3
|
-
type ResponsiveConfirmationProps = Omit<ConfirmationProps, 'confirmationScreens'> & {
|
|
3
|
+
type ResponsiveConfirmationProps = Omit<ConfirmationProps, 'confirmationScreens' | 'breakpoint'> & {
|
|
4
4
|
/**
|
|
5
5
|
* Контрольная точка, с нее начинается desktop версия
|
|
6
6
|
* @default 1024
|
|
7
7
|
*/
|
|
8
8
|
breakpoint?: number;
|
|
9
9
|
};
|
|
10
|
-
type ConfirmationMedia = 'desktop' | 'mobile';
|
|
11
10
|
declare const ConfirmationResponsive: FC<ResponsiveConfirmationProps>;
|
|
12
|
-
export { ResponsiveConfirmationProps,
|
|
11
|
+
export { ResponsiveConfirmationProps, ConfirmationResponsive };
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { useMatchMedia } from '@alfalab/core-components-mq/modern';
|
|
3
3
|
import { ConfirmationDesktop } from './component.desktop.js';
|
|
4
4
|
import { ConfirmationMobile } from './component.mobile.js';
|
|
5
5
|
import './components/base-confirmation/component.js';
|
|
6
6
|
import 'classnames';
|
|
7
|
+
import '@alfalab/hooks';
|
|
7
8
|
import './context.js';
|
|
8
9
|
import './utils.js';
|
|
9
10
|
import './types.js';
|
|
10
11
|
import './components/screens/initial/component.js';
|
|
11
|
-
import '@alfalab/core-components-button/modern';
|
|
12
|
-
import '@alfalab/core-components-code-input/modern';
|
|
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';
|
|
13
15
|
import '@alfalab/core-components-link/modern';
|
|
14
16
|
import '@alfalab/core-components-typography/modern';
|
|
15
17
|
import './components/header/component.js';
|
|
16
|
-
import './countdown-section-
|
|
17
|
-
import '@alfalab/core-components-
|
|
18
|
+
import './countdown-section-ea7af879.js';
|
|
19
|
+
import '@alfalab/core-components-button/modern';
|
|
20
|
+
import '@alfalab/core-components-spinner/modern';
|
|
18
21
|
import './components/screens/hint/component.js';
|
|
19
22
|
import './components/screens/fatal-error/component.js';
|
|
20
23
|
import './components/screens/temp-block/component.js';
|
|
21
24
|
import './components/countdown-loader/component.js';
|
|
22
25
|
|
|
23
26
|
const ConfirmationResponsive = ({ breakpoint = 1024, ...restProps }) => {
|
|
24
|
-
const [
|
|
25
|
-
|
|
26
|
-
['desktop', `(min-width: ${breakpoint}px)`],
|
|
27
|
-
], 'desktop');
|
|
28
|
-
return view === 'desktop' ? (React.createElement(ConfirmationDesktop, { ...restProps })) : (React.createElement(ConfirmationMobile, { ...restProps }));
|
|
27
|
+
const [isDesktop] = useMatchMedia(`(min-width: ${breakpoint}px)`, true);
|
|
28
|
+
return isDesktop ? (React.createElement(ConfirmationDesktop, { ...restProps })) : (React.createElement(ConfirmationMobile, { breakpoint: breakpoint, ...restProps }));
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export { ConfirmationResponsive };
|
|
@@ -8,16 +8,18 @@ import { Initial } from '../screens/initial/component.js';
|
|
|
8
8
|
import { Hint } from '../screens/hint/component.js';
|
|
9
9
|
import { FatalError } from '../screens/fatal-error/component.js';
|
|
10
10
|
import { TempBlock } from '../screens/temp-block/component.js';
|
|
11
|
-
import '@alfalab/core-components-button/modern';
|
|
12
|
-
import '@alfalab/core-components-code-input/modern';
|
|
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';
|
|
13
14
|
import '@alfalab/core-components-link/modern';
|
|
14
15
|
import '@alfalab/core-components-typography/modern';
|
|
15
16
|
import '../header/component.js';
|
|
16
|
-
import '../../countdown-section-
|
|
17
|
-
import '@alfalab/core-components-
|
|
17
|
+
import '../../countdown-section-ea7af879.js';
|
|
18
|
+
import '@alfalab/core-components-button/modern';
|
|
19
|
+
import '@alfalab/core-components-spinner/modern';
|
|
18
20
|
import '../countdown-loader/component.js';
|
|
19
21
|
|
|
20
|
-
const styles = {"component":"
|
|
22
|
+
const styles = {"component":"confirmation__component_yc1y8"};
|
|
21
23
|
require('./index.css')
|
|
22
24
|
|
|
23
25
|
const confirmationScreens = {
|
|
@@ -26,7 +28,7 @@ const confirmationScreens = {
|
|
|
26
28
|
FATAL_ERROR: FatalError,
|
|
27
29
|
TEMP_BLOCK: TempBlock,
|
|
28
30
|
};
|
|
29
|
-
const BaseConfirmation = ({ state, screen, alignContent = 'left', children, requiredCharAmount = 5, countdownDuration = ONE_MINUTE, tempBlockDuration = ONE_DAY, phone, blockSmsRetry, dataTestId, className, getScreensMap, onInputFinished, onChangeState, onSmsRetryClick, onChangeScreen, onFatalErrorOkButtonClick, onTempBlockFinished, mobile, clearCodeOnError = true, hideCountdownSection = false, ...restProps }) => {
|
|
31
|
+
const BaseConfirmation = ({ state, screen, alignContent = 'left', children, requiredCharAmount = 5, countdownDuration = ONE_MINUTE, tempBlockDuration = ONE_DAY, phone, blockSmsRetry, dataTestId, className, getScreensMap, onInputFinished, onChangeState, onSmsRetryClick, onChangeScreen, onFatalErrorOkButtonClick, onTempBlockFinished, mobile, clearCodeOnError = true, hideCountdownSection = false, breakpoint = 1024, initialScreenHintSlot, ...restProps }) => {
|
|
30
32
|
const [timeLeft, startTimer, stopTimer] = useCountdown(countdownDuration);
|
|
31
33
|
const prevState = usePrevious(state);
|
|
32
34
|
useEffect(() => {
|
|
@@ -74,10 +76,12 @@ const BaseConfirmation = ({ state, screen, alignContent = 'left', children, requ
|
|
|
74
76
|
tempBlockDuration,
|
|
75
77
|
phone,
|
|
76
78
|
blockSmsRetry,
|
|
79
|
+
breakpoint,
|
|
77
80
|
onTempBlockFinished,
|
|
78
81
|
onChangeState,
|
|
79
82
|
onChangeScreen,
|
|
80
83
|
clearCodeOnError,
|
|
84
|
+
initialScreenHintSlot,
|
|
81
85
|
onInputFinished: handleInputFinished,
|
|
82
86
|
onSmsRetryClick: handleSmsRetry,
|
|
83
87
|
onFatalErrorOkButtonClick: handleFatalErrorOkButtonClick,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: y79yc */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-text-secondary: rgba(60, 60, 67, 0.66); /* 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 */
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
} :root {
|
|
16
16
|
} :root {
|
|
17
17
|
} :root {
|
|
18
|
-
} .
|
|
18
|
+
} .confirmation__component_yc1y8 {
|
|
19
19
|
width: 100%;
|
|
20
20
|
max-width: 388px;
|
|
21
21
|
margin: 0 auto;
|
|
@@ -6,13 +6,15 @@ import '../../context.js';
|
|
|
6
6
|
import '../../utils.js';
|
|
7
7
|
import '../../types.js';
|
|
8
8
|
import '../screens/initial/component.js';
|
|
9
|
-
import '@alfalab/core-components-button/modern';
|
|
10
|
-
import '@alfalab/core-components-code-input/modern';
|
|
9
|
+
import '@alfalab/core-components-button/modern/mobile';
|
|
10
|
+
import '@alfalab/core-components-code-input/modern/desktop';
|
|
11
|
+
import '@alfalab/core-components-code-input/modern/mobile';
|
|
11
12
|
import '@alfalab/core-components-link/modern';
|
|
12
13
|
import '@alfalab/core-components-typography/modern';
|
|
13
14
|
import '../header/component.js';
|
|
14
|
-
import '../../countdown-section-
|
|
15
|
-
import '@alfalab/core-components-
|
|
15
|
+
import '../../countdown-section-ea7af879.js';
|
|
16
|
+
import '@alfalab/core-components-button/modern';
|
|
17
|
+
import '@alfalab/core-components-spinner/modern';
|
|
16
18
|
import '../screens/hint/component.js';
|
|
17
19
|
import '../screens/fatal-error/component.js';
|
|
18
20
|
import '../screens/temp-block/component.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 3um9q */
|
|
2
2
|
:root {
|
|
3
3
|
} /* deprecated */ :root {
|
|
4
4
|
--color-light-graphic-tertiary: #c1c1c3; /* 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 */
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
} :root {
|
|
16
16
|
} :root {
|
|
17
17
|
} :root {
|
|
18
|
-
} .
|
|
18
|
+
} .confirmation__circle_xhpak {
|
|
19
19
|
fill: transparent;
|
|
20
20
|
stroke: var(--color-light-graphic-tertiary);
|
|
21
21
|
stroke-width: 2px;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { Typography } from '@alfalab/core-components-typography/modern';
|
|
4
4
|
|
|
5
|
-
const styles = {"header":"
|
|
5
|
+
const styles = {"header":"confirmation__header_1olfk","typography":"confirmation__typography_1olfk","typographyMobile":"confirmation__typographyMobile_1olfk"};
|
|
6
6
|
require('./index.css')
|
|
7
7
|
|
|
8
8
|
const Header = ({ mobile, children }) => (React.createElement(Typography.Title, { className: cn(styles.header, styles.typography, { [styles.typographyMobile]: mobile }), tag: 'h3', color: 'primary' }, children));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 16j1o */
|
|
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 */
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
|
|
35
35
|
/* header */
|
|
36
36
|
--confirmation-header-font-feature-settings: normal
|
|
37
|
-
} .
|
|
37
|
+
} .confirmation__header_1olfk.confirmation__header_1olfk {
|
|
38
38
|
margin-bottom: var(--gap-xl);
|
|
39
|
-
} .
|
|
39
|
+
} .confirmation__typography_1olfk.confirmation__typography_1olfk.confirmation__typography_1olfk {
|
|
40
40
|
font-feature-settings: var(--confirmation-header-font-feature-settings);
|
|
41
41
|
font-size: var(--confirmation-header-desktop-font-size);
|
|
42
42
|
line-height: var(--confirmation-header-desktop-line-height);
|
|
43
43
|
font-weight: var(--confirmation-header-desktop-font-weight);
|
|
44
44
|
font-family: var(--confirmation-header-desktop-font-family);
|
|
45
|
-
} .
|
|
45
|
+
} .confirmation__typographyMobile_1olfk.confirmation__typographyMobile_1olfk.confirmation__typographyMobile_1olfk {
|
|
46
46
|
font-feature-settings: var(--confirmation-header-font-feature-settings);
|
|
47
47
|
font-size: var(--confirmation-header-mobile-font-size);
|
|
48
48
|
line-height: var(--confirmation-header-mobile-line-height);
|
|
@@ -5,13 +5,15 @@ export { TempBlock } from './screens/temp-block/component.js';
|
|
|
5
5
|
export { CountdownLoader } from './countdown-loader/component.js';
|
|
6
6
|
import 'react';
|
|
7
7
|
import 'classnames';
|
|
8
|
-
import '@alfalab/core-components-button/modern';
|
|
9
|
-
import '@alfalab/core-components-code-input/modern';
|
|
8
|
+
import '@alfalab/core-components-button/modern/mobile';
|
|
9
|
+
import '@alfalab/core-components-code-input/modern/desktop';
|
|
10
|
+
import '@alfalab/core-components-code-input/modern/mobile';
|
|
10
11
|
import '@alfalab/core-components-link/modern';
|
|
11
12
|
import '@alfalab/core-components-typography/modern';
|
|
12
13
|
import '@alfalab/hooks';
|
|
13
14
|
import '../context.js';
|
|
14
15
|
import '../utils.js';
|
|
15
16
|
import './header/component.js';
|
|
16
|
-
import '../countdown-section-
|
|
17
|
-
import '@alfalab/core-components-
|
|
17
|
+
import '../countdown-section-ea7af879.js';
|
|
18
|
+
import '@alfalab/core-components-button/modern';
|
|
19
|
+
import '@alfalab/core-components-spinner/modern';
|
|
@@ -6,15 +6,15 @@ import { ConfirmationContext } from '../../../context.js';
|
|
|
6
6
|
import { Header } from '../../header/component.js';
|
|
7
7
|
import '../../../utils.js';
|
|
8
8
|
|
|
9
|
-
const styles = {"component":"
|
|
9
|
+
const styles = {"component":"confirmation__component_1bof9","typographyTheme":"confirmation__typographyTheme_1bof9","left":"confirmation__left_1bof9","center":"confirmation__center_1bof9","button":"confirmation__button_1bof9"};
|
|
10
10
|
require('./index.css')
|
|
11
11
|
|
|
12
12
|
const FatalError = ({ mobile }) => {
|
|
13
|
-
const { alignContent, texts, onFatalErrorOkButtonClick } = useContext(ConfirmationContext);
|
|
13
|
+
const { alignContent, texts, onFatalErrorOkButtonClick, breakpoint } = useContext(ConfirmationContext);
|
|
14
14
|
return (React.createElement("div", { className: cn(styles.component, styles[alignContent]) },
|
|
15
15
|
React.createElement(Header, { mobile: mobile }, texts.fatalErrorTitle),
|
|
16
16
|
React.createElement(Typography.Text, { view: 'primary-medium', color: 'primary', className: cn({ [styles.typographyTheme]: !mobile }) }, texts.fatalErrorDescription),
|
|
17
|
-
React.createElement(Button, { size: mobile ? 'xs' : 's', view: 'secondary', onClick: onFatalErrorOkButtonClick, className: styles.button }, texts.fatalErrorButton)));
|
|
17
|
+
React.createElement(Button, { size: mobile ? 'xs' : 's', view: 'secondary', onClick: onFatalErrorOkButtonClick, className: styles.button, breakpoint: breakpoint }, texts.fatalErrorButton)));
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export { FatalError };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: e2xry */
|
|
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,20 +31,20 @@
|
|
|
31
31
|
--confirmation-text-color: var(--color-light-text-primary)
|
|
32
32
|
|
|
33
33
|
/* header */
|
|
34
|
-
} .
|
|
34
|
+
} .confirmation__component_1bof9 {
|
|
35
35
|
display: flex;
|
|
36
36
|
flex-direction: column;
|
|
37
|
-
} .
|
|
37
|
+
} .confirmation__typographyTheme_1bof9.confirmation__typographyTheme_1bof9 {
|
|
38
38
|
font-size: var(--confirmation-text-font-size);
|
|
39
39
|
line-height: var(--confirmation-text-line-height);
|
|
40
40
|
font-weight: var(--confirmation-text-font-weight);
|
|
41
41
|
font-family: var(--confirmation-text-font-family);
|
|
42
42
|
color: var(--confirmation-text-color);
|
|
43
|
-
} .
|
|
43
|
+
} .confirmation__left_1bof9 {
|
|
44
44
|
align-items: flex-start;
|
|
45
|
-
} .
|
|
45
|
+
} .confirmation__center_1bof9 {
|
|
46
46
|
align-items: center;
|
|
47
47
|
text-align: center;
|
|
48
|
-
} .
|
|
48
|
+
} .confirmation__button_1bof9 {
|
|
49
49
|
margin-top: var(--gap-2xl);
|
|
50
50
|
}
|
|
@@ -7,11 +7,11 @@ import { ConfirmationContext } from '../../../context.js';
|
|
|
7
7
|
import { Header } from '../../header/component.js';
|
|
8
8
|
import '../../../utils.js';
|
|
9
9
|
|
|
10
|
-
const styles = {"component":"
|
|
10
|
+
const styles = {"component":"confirmation__component_qgws3","center":"confirmation__center_qgws3","text":"confirmation__text_qgws3","typographyTheme":"confirmation__typographyTheme_qgws3","phonesWrap":"confirmation__phonesWrap_qgws3","phoneWrap":"confirmation__phoneWrap_qgws3","phoneLink":"confirmation__phoneLink_qgws3","hintButton":"confirmation__hintButton_qgws3","phoneContentMobile":"confirmation__phoneContentMobile_qgws3"};
|
|
11
11
|
require('./index.css')
|
|
12
12
|
|
|
13
13
|
const Hint = ({ mobile }) => {
|
|
14
|
-
const { alignContent, texts, onChangeScreen, onChangeState } = useContext(ConfirmationContext);
|
|
14
|
+
const { alignContent, texts, onChangeScreen, onChangeState, breakpoint } = useContext(ConfirmationContext);
|
|
15
15
|
const handleReturnButtonClick = () => {
|
|
16
16
|
onChangeScreen('INITIAL');
|
|
17
17
|
onChangeState('INITIAL');
|
|
@@ -31,7 +31,7 @@ const Hint = ({ mobile }) => {
|
|
|
31
31
|
? 'В\u00A0Москве и\u00A0за\u00A0границей'
|
|
32
32
|
: ' \u2014\u00A0в\u00A0Москве и\u00A0за\u00A0границей'))),
|
|
33
33
|
React.createElement(Typography.Text, { view: 'primary-medium', color: 'primary', className: cn(styles.text, { [styles.typographyTheme]: !mobile }) }, "\u0415\u0441\u043B\u0438 \u043D\u043E\u043C\u0435\u0440 \u043D\u0435\u00A0\u043C\u0435\u043D\u044F\u043B\u0441\u044F, \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043F\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043D \u0441\u0435\u0440\u0432\u0438\u0441 \u043E\u0442\u043F\u0440\u0430\u0432\u043A\u0438 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439. \u041F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u044C \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u043D\u0435\u0441\u043A\u043E\u043B\u044C\u043A\u043E \u043C\u0438\u043D\u0443\u0442."),
|
|
34
|
-
React.createElement(Button, { size: mobile ? 'xs' : 's', view: 'secondary', onClick: handleReturnButtonClick, className: styles.hintButton }, texts.hintButton)));
|
|
34
|
+
React.createElement(Button, { size: mobile ? 'xs' : 's', view: 'secondary', onClick: handleReturnButtonClick, className: styles.hintButton, breakpoint: breakpoint }, texts.hintButton)));
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
export { Hint };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* hash:
|
|
1
|
+
/* hash: 1cl2j */
|
|
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 */
|
|
@@ -33,38 +33,38 @@
|
|
|
33
33
|
--confirmation-text-color: var(--color-light-text-primary)
|
|
34
34
|
|
|
35
35
|
/* header */
|
|
36
|
-
} .
|
|
36
|
+
} .confirmation__component_qgws3 {
|
|
37
37
|
display: flex;
|
|
38
38
|
flex-direction: column;
|
|
39
39
|
align-items: flex-start
|
|
40
|
-
} .
|
|
40
|
+
} .confirmation__component_qgws3 span:last-of-type {
|
|
41
41
|
margin-bottom: 0;
|
|
42
|
-
} .
|
|
42
|
+
} .confirmation__center_qgws3 {
|
|
43
43
|
align-items: center;
|
|
44
44
|
text-align: center;
|
|
45
|
-
} .
|
|
45
|
+
} .confirmation__text_qgws3.confirmation__text_qgws3 {
|
|
46
46
|
margin-bottom: var(--gap-xl);
|
|
47
|
-
} .
|
|
47
|
+
} .confirmation__typographyTheme_qgws3.confirmation__typographyTheme_qgws3 {
|
|
48
48
|
font-size: var(--confirmation-text-font-size);
|
|
49
49
|
line-height: var(--confirmation-text-line-height);
|
|
50
50
|
font-weight: var(--confirmation-text-font-weight);
|
|
51
51
|
font-family: var(--confirmation-text-font-family);
|
|
52
52
|
color: var(--confirmation-text-color);
|
|
53
|
-
} .
|
|
53
|
+
} .confirmation__phonesWrap_qgws3 {
|
|
54
54
|
display: flex;
|
|
55
55
|
flex-direction: column;
|
|
56
56
|
margin-bottom: var(--gap-xl);
|
|
57
|
-
} .
|
|
57
|
+
} .confirmation__phoneWrap_qgws3 {
|
|
58
58
|
margin-bottom: var(--gap-xs)
|
|
59
|
-
} .
|
|
59
|
+
} .confirmation__phoneWrap_qgws3:last-child {
|
|
60
60
|
margin-bottom: 0;
|
|
61
|
-
} .
|
|
61
|
+
} .confirmation__phoneLink_qgws3.confirmation__phoneLink_qgws3 {
|
|
62
62
|
font-size: 16px;
|
|
63
63
|
line-height: 24px;
|
|
64
64
|
font-weight: 500;
|
|
65
|
-
} .
|
|
65
|
+
} .confirmation__hintButton_qgws3 {
|
|
66
66
|
margin-top: var(--gap-2xl);
|
|
67
|
-
} .
|
|
67
|
+
} .confirmation__phoneContentMobile_qgws3 {
|
|
68
68
|
display: flex;
|
|
69
69
|
flex-direction: column;
|
|
70
70
|
align-items: center;
|
|
@@ -4,14 +4,16 @@ export { FatalError } from './fatal-error/component.js';
|
|
|
4
4
|
export { TempBlock } from './temp-block/component.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'classnames';
|
|
7
|
-
import '@alfalab/core-components-button/modern';
|
|
8
|
-
import '@alfalab/core-components-code-input/modern';
|
|
7
|
+
import '@alfalab/core-components-button/modern/mobile';
|
|
8
|
+
import '@alfalab/core-components-code-input/modern/desktop';
|
|
9
|
+
import '@alfalab/core-components-code-input/modern/mobile';
|
|
9
10
|
import '@alfalab/core-components-link/modern';
|
|
10
11
|
import '@alfalab/core-components-typography/modern';
|
|
11
12
|
import '@alfalab/hooks';
|
|
12
13
|
import '../../context.js';
|
|
13
14
|
import '../../utils.js';
|
|
14
15
|
import '../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 '../countdown-loader/component.js';
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import React, { useContext, useRef, useState, useCallback, useEffect, useLayoutEffect } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { ButtonMobile } from '@alfalab/core-components-button/modern/mobile';
|
|
4
|
+
import { CodeInputDesktop } from '@alfalab/core-components-code-input/modern/desktop';
|
|
5
|
+
import { CodeInputMobile } from '@alfalab/core-components-code-input/modern/mobile';
|
|
5
6
|
import { Link } from '@alfalab/core-components-link/modern';
|
|
6
7
|
import { Typography } from '@alfalab/core-components-typography/modern';
|
|
7
8
|
import { usePrevious } from '@alfalab/hooks';
|
|
8
9
|
import { ConfirmationContext } from '../../../context.js';
|
|
9
10
|
import { Header } from '../../header/component.js';
|
|
10
|
-
import { s as styles, C as CountdownSection } from '../../../countdown-section-
|
|
11
|
+
import { s as styles, C as CountdownSection } from '../../../countdown-section-ea7af879.js';
|
|
11
12
|
import '../../../utils.js';
|
|
12
|
-
import '@alfalab/core-components-
|
|
13
|
+
import '@alfalab/core-components-button/modern';
|
|
14
|
+
import '@alfalab/core-components-spinner/modern';
|
|
13
15
|
|
|
14
16
|
const CODE_SEND_HINT_VISIBLE_DURATION = 2000;
|
|
15
17
|
const Initial = ({ mobile }) => {
|
|
16
|
-
const { state, alignContent, texts, requiredCharAmount, timeLeft, phone, clearCodeOnError, hideCountdownSection, onChangeState, onInputFinished, onChangeScreen, onSmsRetryClick, } = useContext(ConfirmationContext);
|
|
18
|
+
const { state, alignContent, texts, requiredCharAmount, timeLeft, phone, clearCodeOnError, hideCountdownSection, initialScreenHintSlot, onChangeState, onInputFinished, onChangeScreen, onSmsRetryClick, } = useContext(ConfirmationContext);
|
|
17
19
|
const prevState = usePrevious(state);
|
|
18
20
|
const inputRef = useRef(null);
|
|
19
21
|
const [codeSendHintVisible, setCodeSendHintVisible] = useState(false);
|
|
@@ -77,16 +79,26 @@ const Initial = ({ mobile }) => {
|
|
|
77
79
|
}
|
|
78
80
|
return false;
|
|
79
81
|
};
|
|
82
|
+
const renderHintButton = () => {
|
|
83
|
+
if (initialScreenHintSlot) {
|
|
84
|
+
return initialScreenHintSlot;
|
|
85
|
+
}
|
|
86
|
+
if (mobile) {
|
|
87
|
+
return (React.createElement(ButtonMobile, { onClick: handleSmsHintLinkClick, view: 'link', size: 'xs' }, texts.linkToHint));
|
|
88
|
+
}
|
|
89
|
+
return (React.createElement(Link, { onClick: handleSmsHintLinkClick, className: styles.smsComeLink, view: mobile ? 'primary' : 'secondary', pseudo: true }, texts.linkToHint));
|
|
90
|
+
};
|
|
80
91
|
const processing = ['CODE_CHECKING', 'CODE_SENDING'].includes(state);
|
|
81
92
|
const timePassed = timeLeft === 0;
|
|
93
|
+
const ComponentCodeInput = mobile ? CodeInputMobile : CodeInputDesktop;
|
|
82
94
|
return (React.createElement("div", { className: cn(styles.component, styles[alignContent]) },
|
|
83
95
|
React.createElement(Header, { mobile: mobile }, texts.title),
|
|
84
96
|
React.createElement(Typography.Text, { view: 'primary-medium', color: 'primary', className: cn(styles.phone, { [styles.typographyTheme]: !mobile }) },
|
|
85
97
|
"\u041A\u043E\u0434 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D \u043D\u0430 ",
|
|
86
98
|
phone),
|
|
87
|
-
React.createElement(
|
|
99
|
+
React.createElement(ComponentCodeInput, { disabled: processing, error: getCodeInputError(), ref: inputRef, fields: requiredCharAmount, className: cn(styles.containerInput, styles.codeInput), onComplete: handleInputComplete, onChange: handleInputChange, clearCodeOnError: clearCodeOnError, onErrorAnimationEnd: handleErrorAnimationEnd }),
|
|
88
100
|
!hideCountdownSection && (React.createElement(CountdownSection, { processing: processing, timePassed: timePassed, codeSendHintVisible: codeSendHintVisible, handleSmsRetryClick: handleSmsRetryClick, mobile: mobile })),
|
|
89
|
-
|
|
101
|
+
renderHintButton()));
|
|
90
102
|
};
|
|
91
103
|
|
|
92
104
|
export { Initial };
|