@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.
Files changed (181) hide show
  1. package/component.desktop.d.ts +1 -1
  2. package/component.desktop.js +6 -4
  3. package/component.mobile.js +7 -5
  4. package/component.responsive.d.ts +2 -3
  5. package/component.responsive.js +10 -10
  6. package/components/base-confirmation/component.js +11 -7
  7. package/components/base-confirmation/index.css +2 -2
  8. package/components/base-confirmation/index.js +6 -4
  9. package/components/countdown-loader/component.js +1 -1
  10. package/components/countdown-loader/index.css +2 -2
  11. package/components/header/component.js +1 -1
  12. package/components/header/index.css +4 -4
  13. package/components/index.js +6 -4
  14. package/components/screens/fatal-error/component.js +3 -3
  15. package/components/screens/fatal-error/index.css +6 -6
  16. package/components/screens/hint/component.js +3 -3
  17. package/components/screens/hint/index.css +12 -12
  18. package/components/screens/index.js +6 -4
  19. package/components/screens/initial/component.js +23 -11
  20. package/components/screens/initial/countdown-section.js +2 -2
  21. package/components/screens/initial/index.css +17 -20
  22. package/components/screens/initial/index.js +6 -4
  23. package/components/screens/temp-block/component.js +1 -1
  24. package/components/screens/temp-block/index.css +7 -7
  25. package/context.js +2 -0
  26. package/{countdown-section-751424e6.js → countdown-section-b212c5b4.js} +5 -5
  27. package/cssm/component.desktop.d.ts +1 -1
  28. package/cssm/component.desktop.js +5 -3
  29. package/cssm/component.mobile.js +5 -3
  30. package/cssm/component.responsive.d.ts +2 -3
  31. package/cssm/component.responsive.js +9 -9
  32. package/cssm/components/base-confirmation/component.js +9 -5
  33. package/cssm/components/base-confirmation/index.js +5 -3
  34. package/cssm/components/index.js +5 -3
  35. package/cssm/components/screens/fatal-error/component.js +2 -2
  36. package/cssm/components/screens/hint/component.js +2 -2
  37. package/cssm/components/screens/index.js +5 -3
  38. package/cssm/components/screens/initial/component.js +22 -10
  39. package/cssm/components/screens/initial/countdown-section.js +4 -4
  40. package/cssm/components/screens/initial/index.js +5 -3
  41. package/cssm/components/screens/initial/index.module.css +0 -3
  42. package/cssm/context.js +2 -0
  43. package/cssm/desktop.d.ts +1 -1
  44. package/cssm/desktop.js +8 -4
  45. package/cssm/index.d.ts +2 -6
  46. package/cssm/index.js +19 -27
  47. package/cssm/mobile.d.ts +1 -1
  48. package/cssm/mobile.js +8 -4
  49. package/cssm/shared.d.ts +4 -0
  50. package/cssm/shared.js +43 -0
  51. package/cssm/types.d.ts +16 -1
  52. package/desktop.d.ts +1 -1
  53. package/desktop.js +9 -5
  54. package/esm/component.desktop.d.ts +1 -1
  55. package/esm/component.desktop.js +6 -4
  56. package/esm/component.mobile.js +7 -5
  57. package/esm/component.responsive.d.ts +2 -3
  58. package/esm/component.responsive.js +10 -10
  59. package/esm/components/base-confirmation/component.js +11 -7
  60. package/esm/components/base-confirmation/index.css +2 -2
  61. package/esm/components/base-confirmation/index.js +6 -4
  62. package/esm/components/countdown-loader/component.js +1 -1
  63. package/esm/components/countdown-loader/index.css +2 -2
  64. package/esm/components/header/component.js +1 -1
  65. package/esm/components/header/index.css +4 -4
  66. package/esm/components/index.js +6 -4
  67. package/esm/components/screens/fatal-error/component.js +3 -3
  68. package/esm/components/screens/fatal-error/index.css +6 -6
  69. package/esm/components/screens/hint/component.js +3 -3
  70. package/esm/components/screens/hint/index.css +12 -12
  71. package/esm/components/screens/index.js +6 -4
  72. package/esm/components/screens/initial/component.js +19 -7
  73. package/esm/components/screens/initial/countdown-section.js +2 -2
  74. package/esm/components/screens/initial/index.css +17 -20
  75. package/esm/components/screens/initial/index.js +6 -4
  76. package/esm/components/screens/temp-block/component.js +1 -1
  77. package/esm/components/screens/temp-block/index.css +7 -7
  78. package/esm/context.js +2 -0
  79. package/esm/{countdown-section-c4ca26d0.js → countdown-section-83d922ef.js} +5 -5
  80. package/esm/desktop.d.ts +1 -1
  81. package/esm/desktop.js +7 -5
  82. package/esm/index.d.ts +2 -6
  83. package/esm/index.js +18 -15
  84. package/esm/mobile.css +2 -2
  85. package/esm/mobile.d.ts +1 -1
  86. package/esm/mobile.js +7 -5
  87. package/esm/shared.d.ts +4 -0
  88. package/esm/shared.js +20 -0
  89. package/esm/types.d.ts +16 -1
  90. package/index.d.ts +2 -6
  91. package/index.js +17 -25
  92. package/mobile.css +2 -2
  93. package/mobile.d.ts +1 -1
  94. package/mobile.js +9 -5
  95. package/modern/component.desktop.d.ts +1 -1
  96. package/modern/component.desktop.js +6 -4
  97. package/modern/component.mobile.js +7 -5
  98. package/modern/component.responsive.d.ts +2 -3
  99. package/modern/component.responsive.js +10 -10
  100. package/modern/components/base-confirmation/component.js +10 -6
  101. package/modern/components/base-confirmation/index.css +2 -2
  102. package/modern/components/base-confirmation/index.js +6 -4
  103. package/modern/components/countdown-loader/component.js +1 -1
  104. package/modern/components/countdown-loader/index.css +2 -2
  105. package/modern/components/header/component.js +1 -1
  106. package/modern/components/header/index.css +4 -4
  107. package/modern/components/index.js +6 -4
  108. package/modern/components/screens/fatal-error/component.js +3 -3
  109. package/modern/components/screens/fatal-error/index.css +6 -6
  110. package/modern/components/screens/hint/component.js +3 -3
  111. package/modern/components/screens/hint/index.css +12 -12
  112. package/modern/components/screens/index.js +6 -4
  113. package/modern/components/screens/initial/component.js +19 -7
  114. package/modern/components/screens/initial/countdown-section.js +2 -2
  115. package/modern/components/screens/initial/index.css +17 -20
  116. package/modern/components/screens/initial/index.js +6 -4
  117. package/modern/components/screens/temp-block/component.js +1 -1
  118. package/modern/components/screens/temp-block/index.css +7 -7
  119. package/modern/context.js +2 -0
  120. package/modern/{countdown-section-473f17f4.js → countdown-section-ea7af879.js} +5 -5
  121. package/modern/desktop.d.ts +1 -1
  122. package/modern/desktop.js +7 -5
  123. package/modern/index.d.ts +2 -6
  124. package/modern/index.js +18 -15
  125. package/modern/mobile.css +2 -2
  126. package/modern/mobile.d.ts +1 -1
  127. package/modern/mobile.js +7 -5
  128. package/modern/shared.d.ts +4 -0
  129. package/modern/shared.js +20 -0
  130. package/modern/types.d.ts +16 -1
  131. package/package.json +31 -6
  132. package/shared.d.ts +4 -0
  133. package/shared.js +37 -0
  134. package/src/component.desktop.tsx +10 -0
  135. package/src/component.mobile.tsx +13 -0
  136. package/src/component.responsive.tsx +31 -0
  137. package/src/components/base-confirmation/component.tsx +125 -0
  138. package/src/components/base-confirmation/index.module.css +8 -0
  139. package/src/components/base-confirmation/index.ts +1 -0
  140. package/src/components/countdown-loader/component.tsx +37 -0
  141. package/src/components/countdown-loader/index.module.css +7 -0
  142. package/src/components/countdown-loader/index.ts +1 -0
  143. package/src/components/header/component.tsx +28 -0
  144. package/src/components/header/index.module.css +21 -0
  145. package/src/components/header/index.ts +1 -0
  146. package/src/components/index.ts +2 -0
  147. package/src/components/screens/fatal-error/component.tsx +46 -0
  148. package/src/components/screens/fatal-error/index.module.css +23 -0
  149. package/src/components/screens/fatal-error/index.ts +1 -0
  150. package/src/components/screens/hint/component.tsx +94 -0
  151. package/src/components/screens/hint/index.module.css +51 -0
  152. package/src/components/screens/hint/index.ts +1 -0
  153. package/src/components/screens/index.ts +4 -0
  154. package/src/components/screens/initial/component.tsx +203 -0
  155. package/src/components/screens/initial/countdown-section.tsx +79 -0
  156. package/src/components/screens/initial/index.module.css +71 -0
  157. package/src/components/screens/initial/index.ts +1 -0
  158. package/src/components/screens/temp-block/component.tsx +58 -0
  159. package/src/components/screens/temp-block/index.module.css +28 -0
  160. package/src/components/screens/temp-block/index.ts +1 -0
  161. package/src/context.ts +27 -0
  162. package/src/desktop.ts +3 -0
  163. package/src/index.ts +6 -0
  164. package/src/mobile.module.css +3 -0
  165. package/src/mobile.ts +3 -0
  166. package/src/shared.ts +4 -0
  167. package/src/types.ts +228 -0
  168. package/src/utils.ts +107 -0
  169. package/src/vars.css +33 -0
  170. package/types.d.ts +16 -1
  171. package/cssm/responsive.d.ts +0 -2
  172. package/cssm/responsive.js +0 -39
  173. package/esm/responsive.d.ts +0 -2
  174. package/esm/responsive.js +0 -23
  175. package/modern/responsive.d.ts +0 -2
  176. package/modern/responsive.js +0 -22
  177. package/responsive.d.ts +0 -2
  178. package/responsive.js +0 -31
  179. /package/{countdown-section-751424e6.d.ts → countdown-section-b212c5b4.d.ts} +0 -0
  180. /package/esm/{countdown-section-c4ca26d0.d.ts → countdown-section-83d922ef.d.ts} +0 -0
  181. /package/modern/{countdown-section-473f17f4.d.ts → countdown-section-ea7af879.d.ts} +0 -0
package/cssm/context.js CHANGED
@@ -17,6 +17,8 @@ var ConfirmationContext = React.createContext({
17
17
  tempBlockDuration: utils.ONE_DAY,
18
18
  phone: '',
19
19
  hideCountdownSection: false,
20
+ breakpoint: 1024,
21
+ initialScreenHintSlot: null,
20
22
  onTempBlockFinished: mockFn,
21
23
  onInputFinished: mockFn,
22
24
  onChangeState: mockFn,
package/cssm/desktop.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export * from "./component.desktop";
2
- export {};
2
+ export { useConfirmation, useCountdown } from "./utils";
package/cssm/desktop.js CHANGED
@@ -3,23 +3,25 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var component_desktop = require('./component.desktop.js');
6
+ var utils = require('./utils.js');
6
7
  require('tslib');
7
8
  require('react');
8
9
  require('./components/base-confirmation/component.js');
9
10
  require('classnames');
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/cssm');
16
- require('@alfalab/core-components-code-input/cssm');
15
+ require('@alfalab/core-components-button/cssm/mobile');
16
+ require('@alfalab/core-components-code-input/cssm/desktop');
17
+ require('@alfalab/core-components-code-input/cssm/mobile');
17
18
  require('@alfalab/core-components-link/cssm');
18
19
  require('@alfalab/core-components-typography/cssm');
19
20
  require('./components/header/component.js');
20
21
  require('./components/header/index.module.css');
21
22
  require('./components/screens/initial/countdown-section.js');
22
- require('@alfalab/core-components-loader/cssm');
23
+ require('@alfalab/core-components-button/cssm');
24
+ require('@alfalab/core-components-spinner/cssm');
23
25
  require('./components/screens/initial/index.module.css');
24
26
  require('./components/screens/hint/component.js');
25
27
  require('./components/screens/hint/index.module.css');
@@ -34,3 +36,5 @@ require('./components/base-confirmation/index.module.css');
34
36
 
35
37
 
36
38
  exports.ConfirmationDesktop = component_desktop.ConfirmationDesktop;
39
+ exports.useConfirmation = utils.useConfirmation;
40
+ exports.useCountdown = utils.useCountdown;
package/cssm/index.d.ts CHANGED
@@ -1,6 +1,2 @@
1
- export { ConfirmationDesktop as Confirmation } from "./desktop";
2
- export * from "./responsive";
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/cssm/index.js CHANGED
@@ -2,51 +2,43 @@
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/cssm');
10
+ require('./component.desktop.js');
17
11
  require('./components/base-confirmation/component.js');
18
12
  require('classnames');
19
13
  require('@alfalab/hooks');
20
- require('./components/base-confirmation/index.module.css');
21
- require('./component.mobile.js');
22
- require('./mobile.module.css');
23
- require('@alfalab/core-components-button/cssm');
24
- require('@alfalab/core-components-code-input/cssm');
14
+ require('./context.js');
15
+ require('./types.js');
16
+ require('./components/screens/initial/component.js');
17
+ require('@alfalab/core-components-button/cssm/mobile');
18
+ require('@alfalab/core-components-code-input/cssm/desktop');
19
+ require('@alfalab/core-components-code-input/cssm/mobile');
25
20
  require('@alfalab/core-components-link/cssm');
26
21
  require('@alfalab/core-components-typography/cssm');
27
22
  require('./components/header/component.js');
28
23
  require('./components/header/index.module.css');
29
24
  require('./components/screens/initial/countdown-section.js');
30
- require('@alfalab/core-components-loader/cssm');
25
+ require('@alfalab/core-components-button/cssm');
26
+ require('@alfalab/core-components-spinner/cssm');
31
27
  require('./components/screens/initial/index.module.css');
28
+ require('./components/screens/hint/component.js');
32
29
  require('./components/screens/hint/index.module.css');
30
+ require('./components/screens/fatal-error/component.js');
33
31
  require('./components/screens/fatal-error/index.module.css');
34
- require('./components/screens/temp-block/index.module.css');
32
+ require('./components/screens/temp-block/component.js');
33
+ require('./components/countdown-loader/component.js');
35
34
  require('./components/countdown-loader/index.module.css');
35
+ require('./components/screens/temp-block/index.module.css');
36
+ require('./components/base-confirmation/index.module.css');
37
+ require('./component.mobile.js');
38
+ require('./mobile.module.css');
36
39
 
37
40
 
38
41
 
39
- exports.Confirmation = component_desktop.ConfirmationDesktop;
40
- exports.ConfirmationResponsive = component_responsive.ConfirmationResponsive;
41
- exports.Initial = components_screens_initial_component.Initial;
42
- exports.Hint = components_screens_hint_component.Hint;
43
- exports.FatalError = components_screens_fatalError_component.FatalError;
44
- exports.TempBlock = components_screens_tempBlock_component.TempBlock;
45
- exports.CountdownLoader = components_countdownLoader_component.CountdownLoader;
46
- exports.ConfirmationContext = context.ConfirmationContext;
47
- exports.defaultTexts = types.defaultTexts;
48
- exports.ONE_DAY = utils.ONE_DAY;
49
- exports.ONE_MINUTE = utils.ONE_MINUTE;
50
- exports.formatMsAsMinutes = utils.formatMsAsMinutes;
42
+ exports.Confirmation = component_responsive.ConfirmationResponsive;
51
43
  exports.useConfirmation = utils.useConfirmation;
52
44
  exports.useCountdown = utils.useCountdown;
package/cssm/mobile.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export * from "./component.mobile";
2
- export {};
2
+ export { useConfirmation, useCountdown } from "./utils";
package/cssm/mobile.js CHANGED
@@ -3,23 +3,25 @@
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/cssm');
16
- require('@alfalab/core-components-code-input/cssm');
15
+ require('@alfalab/core-components-button/cssm/mobile');
16
+ require('@alfalab/core-components-code-input/cssm/desktop');
17
+ require('@alfalab/core-components-code-input/cssm/mobile');
17
18
  require('@alfalab/core-components-link/cssm');
18
19
  require('@alfalab/core-components-typography/cssm');
19
20
  require('./components/header/component.js');
20
21
  require('./components/header/index.module.css');
21
22
  require('./components/screens/initial/countdown-section.js');
22
- require('@alfalab/core-components-loader/cssm');
23
+ require('@alfalab/core-components-button/cssm');
24
+ require('@alfalab/core-components-spinner/cssm');
23
25
  require('./components/screens/initial/index.module.css');
24
26
  require('./components/screens/hint/component.js');
25
27
  require('./components/screens/hint/index.module.css');
@@ -35,3 +37,5 @@ require('./mobile.module.css');
35
37
 
36
38
 
37
39
  exports.ConfirmationMobile = component_mobile.ConfirmationMobile;
40
+ exports.useConfirmation = utils.useConfirmation;
41
+ exports.useCountdown = utils.useCountdown;
@@ -0,0 +1,4 @@
1
+ export * from "./components/index";
2
+ export * from "./context";
3
+ export * from "./types";
4
+ export { formatMsAsMinutes, ONE_MINUTE, ONE_DAY } from "./utils";
package/cssm/shared.js ADDED
@@ -0,0 +1,43 @@
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/cssm/mobile');
16
+ require('@alfalab/core-components-code-input/cssm/desktop');
17
+ require('@alfalab/core-components-code-input/cssm/mobile');
18
+ require('@alfalab/core-components-link/cssm');
19
+ require('@alfalab/core-components-typography/cssm');
20
+ require('@alfalab/hooks');
21
+ require('./components/header/component.js');
22
+ require('./components/header/index.module.css');
23
+ require('./components/screens/initial/countdown-section.js');
24
+ require('@alfalab/core-components-button/cssm');
25
+ require('@alfalab/core-components-spinner/cssm');
26
+ require('./components/screens/initial/index.module.css');
27
+ require('./components/screens/hint/index.module.css');
28
+ require('./components/screens/fatal-error/index.module.css');
29
+ require('./components/screens/temp-block/index.module.css');
30
+ require('./components/countdown-loader/index.module.css');
31
+
32
+
33
+
34
+ exports.Initial = components_screens_initial_component.Initial;
35
+ exports.Hint = components_screens_hint_component.Hint;
36
+ exports.FatalError = components_screens_fatalError_component.FatalError;
37
+ exports.TempBlock = components_screens_tempBlock_component.TempBlock;
38
+ exports.CountdownLoader = components_countdownLoader_component.CountdownLoader;
39
+ exports.ConfirmationContext = context.ConfirmationContext;
40
+ exports.defaultTexts = types.defaultTexts;
41
+ exports.ONE_DAY = utils.ONE_DAY;
42
+ exports.ONE_MINUTE = utils.ONE_MINUTE;
43
+ exports.formatMsAsMinutes = utils.formatMsAsMinutes;
package/cssm/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/desktop.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export * from "./component.desktop";
2
- export {};
2
+ export { useConfirmation, useCountdown } from "./utils";
package/desktop.js CHANGED
@@ -3,22 +3,24 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var component_desktop = require('./component.desktop.js');
6
+ var utils = require('./utils.js');
6
7
  require('tslib');
7
8
  require('react');
8
9
  require('./components/base-confirmation/component.js');
9
10
  require('classnames');
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-751424e6.js');
21
- require('@alfalab/core-components-loader');
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.ConfirmationDesktop = component_desktop.ConfirmationDesktop;
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 };
@@ -7,13 +7,15 @@ import './context.js';
7
7
  import './utils.js';
8
8
  import './types.js';
9
9
  import './components/screens/initial/component.js';
10
- import '@alfalab/core-components-button/esm';
11
- import '@alfalab/core-components-code-input/esm';
10
+ import '@alfalab/core-components-button/esm/mobile';
11
+ import '@alfalab/core-components-code-input/esm/desktop';
12
+ import '@alfalab/core-components-code-input/esm/mobile';
12
13
  import '@alfalab/core-components-link/esm';
13
14
  import '@alfalab/core-components-typography/esm';
14
15
  import './components/header/component.js';
15
- import './countdown-section-c4ca26d0.js';
16
- import '@alfalab/core-components-loader/esm';
16
+ import './countdown-section-83d922ef.js';
17
+ import '@alfalab/core-components-button/esm';
18
+ import '@alfalab/core-components-spinner/esm';
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';
@@ -7,19 +7,21 @@ import './context.js';
7
7
  import './utils.js';
8
8
  import './types.js';
9
9
  import './components/screens/initial/component.js';
10
- import '@alfalab/core-components-button/esm';
11
- import '@alfalab/core-components-code-input/esm';
10
+ import '@alfalab/core-components-button/esm/mobile';
11
+ import '@alfalab/core-components-code-input/esm/desktop';
12
+ import '@alfalab/core-components-code-input/esm/mobile';
12
13
  import '@alfalab/core-components-link/esm';
13
14
  import '@alfalab/core-components-typography/esm';
14
15
  import './components/header/component.js';
15
- import './countdown-section-c4ca26d0.js';
16
- import '@alfalab/core-components-loader/esm';
16
+ import './countdown-section-83d922ef.js';
17
+ import '@alfalab/core-components-button/esm';
18
+ import '@alfalab/core-components-spinner/esm';
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';
20
22
  import './components/countdown-loader/component.js';
21
23
 
22
- var styles = {"container":"confirmation__container_12tpe"};
24
+ var styles = {"container":"confirmation__container_bsppw"};
23
25
  require('./mobile.css')
24
26
 
25
27
  var ConfirmationMobile = function (_a) {
@@ -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, ConfirmationMedia, ConfirmationResponsive };
11
+ export { ResponsiveConfirmationProps, ConfirmationResponsive };
@@ -1,21 +1,24 @@
1
1
  import { __rest, __assign } from 'tslib';
2
2
  import React from 'react';
3
- import { useMedia } from '@alfalab/hooks';
3
+ import { useMatchMedia } from '@alfalab/core-components-mq/esm';
4
4
  import { ConfirmationDesktop } from './component.desktop.js';
5
5
  import { ConfirmationMobile } from './component.mobile.js';
6
6
  import './components/base-confirmation/component.js';
7
7
  import 'classnames';
8
+ import '@alfalab/hooks';
8
9
  import './context.js';
9
10
  import './utils.js';
10
11
  import './types.js';
11
12
  import './components/screens/initial/component.js';
12
- import '@alfalab/core-components-button/esm';
13
- import '@alfalab/core-components-code-input/esm';
13
+ import '@alfalab/core-components-button/esm/mobile';
14
+ import '@alfalab/core-components-code-input/esm/desktop';
15
+ import '@alfalab/core-components-code-input/esm/mobile';
14
16
  import '@alfalab/core-components-link/esm';
15
17
  import '@alfalab/core-components-typography/esm';
16
18
  import './components/header/component.js';
17
- import './countdown-section-c4ca26d0.js';
18
- import '@alfalab/core-components-loader/esm';
19
+ import './countdown-section-83d922ef.js';
20
+ import '@alfalab/core-components-button/esm';
21
+ import '@alfalab/core-components-spinner/esm';
19
22
  import './components/screens/hint/component.js';
20
23
  import './components/screens/fatal-error/component.js';
21
24
  import './components/screens/temp-block/component.js';
@@ -23,11 +26,8 @@ import './components/countdown-loader/component.js';
23
26
 
24
27
  var ConfirmationResponsive = function (_a) {
25
28
  var _b = _a.breakpoint, breakpoint = _b === void 0 ? 1024 : _b, restProps = __rest(_a, ["breakpoint"]);
26
- var view = useMedia([
27
- ['mobile', "(max-width: ".concat(breakpoint - 1, "px)")],
28
- ['desktop', "(min-width: ".concat(breakpoint, "px)")],
29
- ], 'desktop')[0];
30
- return view === 'desktop' ? (React.createElement(ConfirmationDesktop, __assign({}, restProps))) : (React.createElement(ConfirmationMobile, __assign({}, restProps)));
29
+ var isDesktop = useMatchMedia("(min-width: ".concat(breakpoint, "px)"), true)[0];
30
+ return isDesktop ? (React.createElement(ConfirmationDesktop, __assign({}, restProps))) : (React.createElement(ConfirmationMobile, __assign({ breakpoint: breakpoint }, restProps)));
31
31
  };
32
32
 
33
33
  export { ConfirmationResponsive };
@@ -9,16 +9,18 @@ import { Initial } from '../screens/initial/component.js';
9
9
  import { Hint } from '../screens/hint/component.js';
10
10
  import { FatalError } from '../screens/fatal-error/component.js';
11
11
  import { TempBlock } from '../screens/temp-block/component.js';
12
- import '@alfalab/core-components-button/esm';
13
- import '@alfalab/core-components-code-input/esm';
12
+ import '@alfalab/core-components-button/esm/mobile';
13
+ import '@alfalab/core-components-code-input/esm/desktop';
14
+ import '@alfalab/core-components-code-input/esm/mobile';
14
15
  import '@alfalab/core-components-link/esm';
15
16
  import '@alfalab/core-components-typography/esm';
16
17
  import '../header/component.js';
17
- import '../../countdown-section-c4ca26d0.js';
18
- import '@alfalab/core-components-loader/esm';
18
+ import '../../countdown-section-83d922ef.js';
19
+ import '@alfalab/core-components-button/esm';
20
+ import '@alfalab/core-components-spinner/esm';
19
21
  import '../countdown-loader/component.js';
20
22
 
21
- var styles = {"component":"confirmation__component_ok5k8"};
23
+ var styles = {"component":"confirmation__component_yc1y8"};
22
24
  require('./index.css')
23
25
 
24
26
  var confirmationScreens = {
@@ -28,8 +30,8 @@ var confirmationScreens = {
28
30
  TEMP_BLOCK: TempBlock,
29
31
  };
30
32
  var BaseConfirmation = function (_a) {
31
- var state = _a.state, screen = _a.screen, _b = _a.alignContent, alignContent = _b === void 0 ? 'left' : _b; _a.children; var _c = _a.requiredCharAmount, requiredCharAmount = _c === void 0 ? 5 : _c, _d = _a.countdownDuration, countdownDuration = _d === void 0 ? ONE_MINUTE : _d, _e = _a.tempBlockDuration, tempBlockDuration = _e === void 0 ? ONE_DAY : _e, phone = _a.phone, blockSmsRetry = _a.blockSmsRetry, dataTestId = _a.dataTestId, className = _a.className, getScreensMap = _a.getScreensMap, onInputFinished = _a.onInputFinished, onChangeState = _a.onChangeState, onSmsRetryClick = _a.onSmsRetryClick, onChangeScreen = _a.onChangeScreen, onFatalErrorOkButtonClick = _a.onFatalErrorOkButtonClick, onTempBlockFinished = _a.onTempBlockFinished, mobile = _a.mobile, _f = _a.clearCodeOnError, clearCodeOnError = _f === void 0 ? true : _f, _g = _a.hideCountdownSection, hideCountdownSection = _g === void 0 ? false : _g, restProps = __rest(_a, ["state", "screen", "alignContent", "children", "requiredCharAmount", "countdownDuration", "tempBlockDuration", "phone", "blockSmsRetry", "dataTestId", "className", "getScreensMap", "onInputFinished", "onChangeState", "onSmsRetryClick", "onChangeScreen", "onFatalErrorOkButtonClick", "onTempBlockFinished", "mobile", "clearCodeOnError", "hideCountdownSection"]);
32
- var _h = useCountdown(countdownDuration), timeLeft = _h[0], startTimer = _h[1], stopTimer = _h[2];
33
+ var state = _a.state, screen = _a.screen, _b = _a.alignContent, alignContent = _b === void 0 ? 'left' : _b; _a.children; var _c = _a.requiredCharAmount, requiredCharAmount = _c === void 0 ? 5 : _c, _d = _a.countdownDuration, countdownDuration = _d === void 0 ? ONE_MINUTE : _d, _e = _a.tempBlockDuration, tempBlockDuration = _e === void 0 ? ONE_DAY : _e, phone = _a.phone, blockSmsRetry = _a.blockSmsRetry, dataTestId = _a.dataTestId, className = _a.className, getScreensMap = _a.getScreensMap, onInputFinished = _a.onInputFinished, onChangeState = _a.onChangeState, onSmsRetryClick = _a.onSmsRetryClick, onChangeScreen = _a.onChangeScreen, onFatalErrorOkButtonClick = _a.onFatalErrorOkButtonClick, onTempBlockFinished = _a.onTempBlockFinished, mobile = _a.mobile, _f = _a.clearCodeOnError, clearCodeOnError = _f === void 0 ? true : _f, _g = _a.hideCountdownSection, hideCountdownSection = _g === void 0 ? false : _g, _h = _a.breakpoint, breakpoint = _h === void 0 ? 1024 : _h, initialScreenHintSlot = _a.initialScreenHintSlot, restProps = __rest(_a, ["state", "screen", "alignContent", "children", "requiredCharAmount", "countdownDuration", "tempBlockDuration", "phone", "blockSmsRetry", "dataTestId", "className", "getScreensMap", "onInputFinished", "onChangeState", "onSmsRetryClick", "onChangeScreen", "onFatalErrorOkButtonClick", "onTempBlockFinished", "mobile", "clearCodeOnError", "hideCountdownSection", "breakpoint", "initialScreenHintSlot"]);
34
+ var _j = useCountdown(countdownDuration), timeLeft = _j[0], startTimer = _j[1], stopTimer = _j[2];
33
35
  var prevState = usePrevious(state);
34
36
  useEffect(function () {
35
37
  startTimer();
@@ -76,10 +78,12 @@ var BaseConfirmation = function (_a) {
76
78
  tempBlockDuration: tempBlockDuration,
77
79
  phone: phone,
78
80
  blockSmsRetry: blockSmsRetry,
81
+ breakpoint: breakpoint,
79
82
  onTempBlockFinished: onTempBlockFinished,
80
83
  onChangeState: onChangeState,
81
84
  onChangeScreen: onChangeScreen,
82
85
  clearCodeOnError: clearCodeOnError,
86
+ initialScreenHintSlot: initialScreenHintSlot,
83
87
  onInputFinished: handleInputFinished,
84
88
  onSmsRetryClick: handleSmsRetry,
85
89
  onFatalErrorOkButtonClick: handleFatalErrorOkButtonClick,
@@ -1,4 +1,4 @@
1
- /* hash: d4gh5 */
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
- } .confirmation__component_ok5k8 {
18
+ } .confirmation__component_yc1y8 {
19
19
  width: 100%;
20
20
  max-width: 388px;
21
21
  margin: 0 auto;
@@ -7,13 +7,15 @@ import '../../context.js';
7
7
  import '../../utils.js';
8
8
  import '../../types.js';
9
9
  import '../screens/initial/component.js';
10
- import '@alfalab/core-components-button/esm';
11
- import '@alfalab/core-components-code-input/esm';
10
+ import '@alfalab/core-components-button/esm/mobile';
11
+ import '@alfalab/core-components-code-input/esm/desktop';
12
+ import '@alfalab/core-components-code-input/esm/mobile';
12
13
  import '@alfalab/core-components-link/esm';
13
14
  import '@alfalab/core-components-typography/esm';
14
15
  import '../header/component.js';
15
- import '../../countdown-section-c4ca26d0.js';
16
- import '@alfalab/core-components-loader/esm';
16
+ import '../../countdown-section-83d922ef.js';
17
+ import '@alfalab/core-components-button/esm';
18
+ import '@alfalab/core-components-spinner/esm';
17
19
  import '../screens/hint/component.js';
18
20
  import '../screens/fatal-error/component.js';
19
21
  import '../screens/temp-block/component.js';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- var styles = {"circle":"confirmation__circle_7eoyn"};
3
+ var styles = {"circle":"confirmation__circle_xhpak"};
4
4
  require('./index.css')
5
5
 
6
6
  var SIZE = 16;
@@ -1,4 +1,4 @@
1
- /* hash: 1o2fd */
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
- } .confirmation__circle_7eoyn {
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/esm';
4
4
 
5
- var styles = {"header":"confirmation__header_13kb8","typography":"confirmation__typography_13kb8","typographyMobile":"confirmation__typographyMobile_13kb8"};
5
+ var styles = {"header":"confirmation__header_1olfk","typography":"confirmation__typography_1olfk","typographyMobile":"confirmation__typographyMobile_1olfk"};
6
6
  require('./index.css')
7
7
 
8
8
  var Header = function (_a) {
@@ -1,4 +1,4 @@
1
- /* hash: b8a68 */
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
- } .confirmation__header_13kb8.confirmation__header_13kb8 {
37
+ } .confirmation__header_1olfk.confirmation__header_1olfk {
38
38
  margin-bottom: var(--gap-xl);
39
- } .confirmation__typography_13kb8.confirmation__typography_13kb8.confirmation__typography_13kb8 {
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
- } .confirmation__typographyMobile_13kb8.confirmation__typographyMobile_13kb8.confirmation__typographyMobile_13kb8 {
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/esm';
9
- import '@alfalab/core-components-code-input/esm';
8
+ import '@alfalab/core-components-button/esm/mobile';
9
+ import '@alfalab/core-components-code-input/esm/desktop';
10
+ import '@alfalab/core-components-code-input/esm/mobile';
10
11
  import '@alfalab/core-components-link/esm';
11
12
  import '@alfalab/core-components-typography/esm';
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-c4ca26d0.js';
17
- import '@alfalab/core-components-loader/esm';
17
+ import '../countdown-section-83d922ef.js';
18
+ import '@alfalab/core-components-button/esm';
19
+ import '@alfalab/core-components-spinner/esm';
@@ -6,17 +6,17 @@ import { ConfirmationContext } from '../../../context.js';
6
6
  import { Header } from '../../header/component.js';
7
7
  import '../../../utils.js';
8
8
 
9
- var styles = {"component":"confirmation__component_l7sv4","typographyTheme":"confirmation__typographyTheme_l7sv4","left":"confirmation__left_l7sv4","center":"confirmation__center_l7sv4","button":"confirmation__button_l7sv4"};
9
+ var 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
  var FatalError = function (_a) {
13
13
  var _b;
14
14
  var mobile = _a.mobile;
15
- var _c = useContext(ConfirmationContext), alignContent = _c.alignContent, texts = _c.texts, onFatalErrorOkButtonClick = _c.onFatalErrorOkButtonClick;
15
+ var _c = useContext(ConfirmationContext), alignContent = _c.alignContent, texts = _c.texts, onFatalErrorOkButtonClick = _c.onFatalErrorOkButtonClick, breakpoint = _c.breakpoint;
16
16
  return (React.createElement("div", { className: cn(styles.component, styles[alignContent]) },
17
17
  React.createElement(Header, { mobile: mobile }, texts.fatalErrorTitle),
18
18
  React.createElement(Typography.Text, { view: 'primary-medium', color: 'primary', className: cn((_b = {}, _b[styles.typographyTheme] = !mobile, _b)) }, texts.fatalErrorDescription),
19
- React.createElement(Button, { size: mobile ? 'xs' : 's', view: 'secondary', onClick: onFatalErrorOkButtonClick, className: styles.button }, texts.fatalErrorButton)));
19
+ React.createElement(Button, { size: mobile ? 'xs' : 's', view: 'secondary', onClick: onFatalErrorOkButtonClick, className: styles.button, breakpoint: breakpoint }, texts.fatalErrorButton)));
20
20
  };
21
21
 
22
22
  export { FatalError };