@alfalab/core-components-confirmation 12.1.3 → 12.2.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 (213) hide show
  1. package/component-40c9adb0.d.ts +35 -0
  2. package/{component.js → component-40c9adb0.js} +11 -18
  3. package/component.desktop.d.ts +5 -0
  4. package/component.desktop.js +31 -0
  5. package/component.mobile.d.ts +5 -0
  6. package/component.mobile.js +38 -0
  7. package/component.responsive.d.ts +6 -0
  8. package/component.responsive.js +39 -0
  9. package/components/base-confirmation/component.d.ts +0 -0
  10. package/components/base-confirmation/component.js +27 -0
  11. package/components/base-confirmation/index.css +24 -0
  12. package/components/base-confirmation/index.d.ts +1 -0
  13. package/components/base-confirmation/index.js +27 -0
  14. package/components/countdown-loader/component.js +1 -1
  15. package/components/countdown-loader/index.css +2 -11
  16. package/components/header/component.d.ts +13 -0
  17. package/components/header/component.js +23 -0
  18. package/components/header/index.css +51 -0
  19. package/components/header/index.d.ts +1 -0
  20. package/components/header/index.js +12 -0
  21. package/components/index.js +4 -2
  22. package/components/screens/fatal-error/component.d.ts +9 -3
  23. package/components/screens/fatal-error/component.js +13 -7
  24. package/components/screens/fatal-error/index.css +17 -29
  25. package/components/screens/fatal-error/index.js +3 -0
  26. package/components/screens/hint/component.d.ts +9 -3
  27. package/components/screens/hint/component.js +17 -17
  28. package/components/screens/hint/index.css +25 -48
  29. package/components/screens/hint/index.js +2 -0
  30. package/components/screens/index.js +4 -2
  31. package/components/screens/initial/component.d.ts +9 -3
  32. package/components/screens/initial/component.js +14 -11
  33. package/components/screens/initial/countdown-section.js +3 -2
  34. package/components/screens/initial/index.css +48 -45
  35. package/components/screens/initial/index.js +4 -2
  36. package/components/screens/temp-block/component.d.ts +9 -3
  37. package/components/screens/temp-block/component.js +13 -7
  38. package/components/screens/temp-block/index.css +12 -30
  39. package/components/screens/temp-block/index.js +3 -0
  40. package/{esm/countdown-section-3aba82dd.d.ts → countdown-section-d04caa75.d.ts} +1 -0
  41. package/countdown-section-d04caa75.js +56 -0
  42. package/cssm/component-5c5b24ae.d.ts +35 -0
  43. package/cssm/{component.js → component-5c5b24ae.js} +10 -22
  44. package/cssm/component.desktop.d.ts +5 -0
  45. package/cssm/component.desktop.js +38 -0
  46. package/cssm/component.mobile.d.ts +5 -0
  47. package/cssm/component.mobile.js +44 -0
  48. package/cssm/component.responsive.d.ts +6 -0
  49. package/cssm/component.responsive.js +47 -0
  50. package/cssm/components/base-confirmation/component.d.ts +0 -0
  51. package/cssm/components/base-confirmation/component.js +34 -0
  52. package/cssm/components/base-confirmation/index.d.ts +1 -0
  53. package/cssm/components/base-confirmation/index.js +34 -0
  54. package/cssm/components/base-confirmation/index.module.css +23 -0
  55. package/cssm/components/countdown-loader/index.module.css +0 -9
  56. package/cssm/components/header/component.d.ts +13 -0
  57. package/cssm/components/header/component.js +22 -0
  58. package/cssm/components/header/index.d.ts +1 -0
  59. package/cssm/components/header/index.js +13 -0
  60. package/cssm/components/header/index.module.css +50 -0
  61. package/cssm/components/index.js +5 -2
  62. package/cssm/components/screens/fatal-error/component.d.ts +9 -3
  63. package/cssm/components/screens/fatal-error/component.js +13 -6
  64. package/cssm/components/screens/fatal-error/index.js +4 -0
  65. package/cssm/components/screens/fatal-error/index.module.css +16 -28
  66. package/cssm/components/screens/hint/component.d.ts +9 -3
  67. package/cssm/components/screens/hint/component.js +17 -16
  68. package/cssm/components/screens/hint/index.js +3 -0
  69. package/cssm/components/screens/hint/index.module.css +17 -40
  70. package/cssm/components/screens/index.js +5 -2
  71. package/cssm/components/screens/initial/component.d.ts +9 -3
  72. package/cssm/components/screens/initial/component.js +15 -11
  73. package/cssm/components/screens/initial/countdown-section.d.ts +1 -0
  74. package/cssm/components/screens/initial/countdown-section.js +25 -10
  75. package/cssm/components/screens/initial/index.js +5 -2
  76. package/cssm/components/screens/initial/index.module.css +37 -34
  77. package/cssm/components/screens/temp-block/component.d.ts +9 -3
  78. package/cssm/components/screens/temp-block/component.js +13 -6
  79. package/cssm/components/screens/temp-block/index.js +4 -0
  80. package/cssm/components/screens/temp-block/index.module.css +9 -27
  81. package/cssm/desktop.d.ts +1 -0
  82. package/cssm/desktop.js +35 -0
  83. package/cssm/index.d.ts +2 -1
  84. package/cssm/index.js +13 -5
  85. package/cssm/mobile.d.ts +1 -0
  86. package/cssm/mobile.js +36 -0
  87. package/cssm/mobile.module.css +3 -0
  88. package/cssm/responsive.d.ts +1 -0
  89. package/cssm/responsive.js +38 -0
  90. package/cssm/types.d.ts +4 -0
  91. package/cssm/vars.css +4 -4
  92. package/desktop.d.ts +1 -0
  93. package/desktop.js +28 -0
  94. package/esm/component-1f28492d.d.ts +35 -0
  95. package/esm/{component.js → component-1f28492d.js} +6 -12
  96. package/esm/component.desktop.d.ts +5 -0
  97. package/esm/component.desktop.js +23 -0
  98. package/esm/component.mobile.d.ts +5 -0
  99. package/esm/component.mobile.js +29 -0
  100. package/esm/component.responsive.d.ts +6 -0
  101. package/esm/component.responsive.js +31 -0
  102. package/esm/components/base-confirmation/component.d.ts +0 -0
  103. package/esm/components/base-confirmation/component.js +19 -0
  104. package/esm/components/base-confirmation/index.css +24 -0
  105. package/esm/components/base-confirmation/index.d.ts +1 -0
  106. package/esm/components/base-confirmation/index.js +19 -0
  107. package/esm/components/countdown-loader/component.js +1 -1
  108. package/esm/components/countdown-loader/index.css +2 -11
  109. package/esm/components/header/component.d.ts +13 -0
  110. package/esm/components/header/component.js +14 -0
  111. package/esm/components/header/index.css +51 -0
  112. package/esm/components/header/index.d.ts +1 -0
  113. package/esm/components/header/index.js +4 -0
  114. package/esm/components/index.js +4 -2
  115. package/esm/components/screens/fatal-error/component.d.ts +9 -3
  116. package/esm/components/screens/fatal-error/component.js +13 -8
  117. package/esm/components/screens/fatal-error/index.css +17 -29
  118. package/esm/components/screens/fatal-error/index.js +3 -0
  119. package/esm/components/screens/hint/component.d.ts +9 -3
  120. package/esm/components/screens/hint/component.js +17 -17
  121. package/esm/components/screens/hint/index.css +25 -48
  122. package/esm/components/screens/hint/index.js +2 -0
  123. package/esm/components/screens/index.js +4 -2
  124. package/esm/components/screens/initial/component.d.ts +9 -3
  125. package/esm/components/screens/initial/component.js +14 -11
  126. package/esm/components/screens/initial/countdown-section.js +3 -2
  127. package/esm/components/screens/initial/index.css +48 -45
  128. package/esm/components/screens/initial/index.js +4 -2
  129. package/esm/components/screens/temp-block/component.d.ts +9 -3
  130. package/esm/components/screens/temp-block/component.js +12 -7
  131. package/esm/components/screens/temp-block/index.css +12 -30
  132. package/esm/components/screens/temp-block/index.js +3 -0
  133. package/{modern/countdown-section-7a5f6574.d.ts → esm/countdown-section-b47c61ca.d.ts} +1 -0
  134. package/esm/countdown-section-b47c61ca.js +48 -0
  135. package/esm/desktop.d.ts +1 -0
  136. package/esm/desktop.js +20 -0
  137. package/esm/index.d.ts +2 -1
  138. package/esm/index.js +8 -3
  139. package/esm/mobile.css +4 -0
  140. package/esm/mobile.d.ts +1 -0
  141. package/esm/mobile.js +20 -0
  142. package/esm/responsive.d.ts +1 -0
  143. package/esm/responsive.js +22 -0
  144. package/esm/types.d.ts +4 -0
  145. package/index.d.ts +2 -1
  146. package/index.js +10 -4
  147. package/mobile.css +4 -0
  148. package/mobile.d.ts +1 -0
  149. package/mobile.js +28 -0
  150. package/modern/component.desktop.d.ts +5 -0
  151. package/modern/component.desktop.js +23 -0
  152. package/modern/component.mobile.d.ts +5 -0
  153. package/modern/component.mobile.js +26 -0
  154. package/modern/component.responsive.d.ts +6 -0
  155. package/modern/component.responsive.js +31 -0
  156. package/modern/components/base-confirmation/component.d.ts +4 -0
  157. package/modern/{component.js → components/base-confirmation/component.js} +16 -14
  158. package/modern/components/base-confirmation/index.css +24 -0
  159. package/modern/components/base-confirmation/index.d.ts +1 -0
  160. package/modern/components/base-confirmation/index.js +19 -0
  161. package/modern/components/countdown-loader/component.js +1 -1
  162. package/modern/components/countdown-loader/index.css +2 -11
  163. package/modern/components/header/component.d.ts +13 -0
  164. package/modern/components/header/component.js +10 -0
  165. package/modern/components/header/index.css +51 -0
  166. package/modern/components/header/index.d.ts +1 -0
  167. package/modern/components/header/index.js +4 -0
  168. package/modern/components/index.js +4 -2
  169. package/modern/components/screens/fatal-error/component.d.ts +9 -3
  170. package/modern/components/screens/fatal-error/component.js +11 -8
  171. package/modern/components/screens/fatal-error/index.css +17 -29
  172. package/modern/components/screens/fatal-error/index.js +3 -0
  173. package/modern/components/screens/hint/component.d.ts +9 -3
  174. package/modern/components/screens/hint/component.js +14 -16
  175. package/modern/components/screens/hint/index.css +25 -48
  176. package/modern/components/screens/hint/index.js +2 -0
  177. package/modern/components/screens/index.js +4 -2
  178. package/modern/components/screens/initial/component.d.ts +9 -3
  179. package/modern/components/screens/initial/component.js +10 -9
  180. package/modern/components/screens/initial/countdown-section.js +3 -2
  181. package/modern/components/screens/initial/index.css +48 -45
  182. package/modern/components/screens/initial/index.js +4 -2
  183. package/modern/components/screens/temp-block/component.d.ts +9 -3
  184. package/modern/components/screens/temp-block/component.js +8 -5
  185. package/modern/components/screens/temp-block/index.css +12 -30
  186. package/modern/components/screens/temp-block/index.js +3 -0
  187. package/{countdown-section-44184a06.d.ts → modern/countdown-section-2212ec31.d.ts} +1 -0
  188. package/modern/countdown-section-2212ec31.js +46 -0
  189. package/modern/desktop.d.ts +1 -0
  190. package/modern/desktop.js +20 -0
  191. package/modern/index.d.ts +2 -1
  192. package/modern/index.js +8 -3
  193. package/modern/mobile.css +4 -0
  194. package/modern/mobile.d.ts +1 -0
  195. package/modern/mobile.js +20 -0
  196. package/modern/responsive.d.ts +1 -0
  197. package/modern/responsive.js +22 -0
  198. package/modern/types.d.ts +4 -0
  199. package/package.json +4 -3
  200. package/responsive.d.ts +1 -0
  201. package/responsive.js +30 -0
  202. package/types.d.ts +4 -0
  203. package/component.d.ts +0 -4
  204. package/countdown-section-44184a06.js +0 -41
  205. package/cssm/component.d.ts +0 -4
  206. package/cssm/index.module.css +0 -46
  207. package/esm/component.d.ts +0 -4
  208. package/esm/countdown-section-3aba82dd.js +0 -33
  209. package/esm/index.css +0 -47
  210. package/index.css +0 -47
  211. package/modern/component.d.ts +0 -4
  212. package/modern/countdown-section-7a5f6574.js +0 -32
  213. package/modern/index.css +0 -47
@@ -5,12 +5,14 @@ import '../../../utils.js';
5
5
  import { ConfirmationContext } from '../../../context.js';
6
6
  import { CodeInput } from '@alfalab/core-components-code-input/modern';
7
7
  import { Link } from '@alfalab/core-components-link/modern';
8
- import { s as styles, C as CountdownSection } from '../../../countdown-section-7a5f6574.js';
8
+ import { Typography } from '@alfalab/core-components-typography/modern';
9
+ import { Button } from '@alfalab/core-components-button/modern';
10
+ import { Header } from '../../header/component.js';
9
11
  import '@alfalab/core-components-loader/modern';
10
- import '@alfalab/core-components-button/modern';
12
+ import { s as styles, C as CountdownSection } from '../../../countdown-section-2212ec31.js';
11
13
 
12
14
  const CODE_SEND_HINT_VISIBLE_DURATION = 2000;
13
- const Initial = () => {
15
+ const Initial = ({ mobile }) => {
14
16
  const { state, alignContent, texts, requiredCharAmount, timeLeft, phone, onChangeState, onInputFinished, onChangeScreen, onSmsRetryClick, } = useContext(ConfirmationContext);
15
17
  const prevState = usePrevious(state);
16
18
  const inputRef = useRef(null);
@@ -73,14 +75,13 @@ const Initial = () => {
73
75
  const processing = ['CODE_CHECKING', 'CODE_SENDING'].includes(state);
74
76
  const timePassed = timeLeft === 0;
75
77
  return (React.createElement("div", { className: cn(styles.component, styles[alignContent]) },
76
- React.createElement("h3", { className: styles.header }, texts.title),
77
- phone && React.createElement("div", { className: styles.phone },
78
+ React.createElement(Header, { mobile: mobile }, texts.title),
79
+ React.createElement(Typography.Text, { view: 'primary-medium', color: 'primary', className: cn(styles.phone, { [styles.typographyTheme]: !mobile }) },
78
80
  "\u041A\u043E\u0434 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D \u043D\u0430 ",
79
81
  phone),
80
- React.createElement("div", { className: styles.inputContainer },
81
- React.createElement(CodeInput, { disabled: processing, error: getCodeInputError(), ref: inputRef, fields: requiredCharAmount, className: styles.codeInput, onComplete: handleInputComplete, onChange: handleInputChange })),
82
- React.createElement(CountdownSection, { processing: processing, timePassed: timePassed, codeSendHintVisible: codeSendHintVisible, handleSmsRetryClick: handleSmsRetryClick }),
83
- React.createElement(Link, { onClick: handleSmsHintLinkClick, className: styles.smsComeLink, view: 'secondary', pseudo: true }, texts.linkToHint)));
82
+ React.createElement(CodeInput, { disabled: processing, error: getCodeInputError(), ref: inputRef, fields: requiredCharAmount, className: cn(styles.containerInput, styles.codeInput), onComplete: handleInputComplete, onChange: handleInputChange }),
83
+ React.createElement(CountdownSection, { processing: processing, timePassed: timePassed, codeSendHintVisible: codeSendHintVisible, handleSmsRetryClick: handleSmsRetryClick, mobile: mobile }),
84
+ mobile ? (React.createElement(Button, { onClick: handleSmsHintLinkClick, view: 'link', size: 'xs' }, texts.linkToHint)) : (React.createElement(Link, { onClick: handleSmsHintLinkClick, className: styles.smsComeLink, view: mobile ? 'primary' : 'secondary', pseudo: true }, texts.linkToHint))));
84
85
  };
85
86
 
86
87
  export { Initial };
@@ -2,6 +2,7 @@ import 'react';
2
2
  import 'classnames';
3
3
  import '../../../utils.js';
4
4
  import '../../../context.js';
5
- export { C as CountdownSection } from '../../../countdown-section-7a5f6574.js';
6
- import '@alfalab/core-components-loader/modern';
5
+ import '@alfalab/core-components-typography/modern';
7
6
  import '@alfalab/core-components-button/modern';
7
+ import '@alfalab/core-components-loader/modern';
8
+ export { C as CountdownSection } from '../../../countdown-section-2212ec31.js';
@@ -1,6 +1,7 @@
1
- /* hash: kyey6 */
1
+ /* hash: mq7s8 */
2
2
  :root {
3
3
  --color-light-text-primary: #0b1f35;
4
+ --color-light-text-secondary: #546272;
4
5
  }
5
6
  :root {
6
7
 
@@ -12,7 +13,9 @@
12
13
  }
13
14
  :root {
14
15
  --gap-2xs: 4px;
16
+ --gap-s: 12px;
15
17
  --gap-m: 16px;
18
+ --gap-l: 20px;
16
19
  --gap-xl: 24px;
17
20
  --gap-2xl: 32px;
18
21
  --gap-2xs-neg: -4px;
@@ -22,80 +25,80 @@
22
25
  sans-serif;
23
26
  }
24
27
  :root {
25
- /* title */
26
- --confirmation-title-font-size: 22px;
27
- --confirmation-title-line-height: 26px;
28
- --confirmation-title-font-weight: 700;
29
- --confirmation-title-font-family: var(--font-family-system);
30
- --confirmation-title-color: var(--color-light-text-primary);
31
- --confirmation-title-font-feature-settings: normal;
28
+ /* desktop */
32
29
 
33
- /* text */
30
+ /* mobile */
34
31
 
35
- /* error */
32
+ /* text */
33
+ --confirmation-text-font-size: 16px;
34
+ --confirmation-text-line-height: 24px;
35
+ --confirmation-text-font-weight: 400;
36
+ --confirmation-text-font-family: var(--font-family-system);
37
+ --confirmation-text-color: var(--color-light-text-primary)
36
38
 
37
- /* input */
39
+ /* header */
38
40
  }
39
- .confirmation__component_66h8v {
41
+ .confirmation__component_1bham {
40
42
  display: flex;
41
43
  flex-direction: column;
42
44
  }
43
- .confirmation__header_66h8v {
44
- margin: 0;
45
- margin-bottom: var(--gap-xl);
46
- font-size: var(--confirmation-title-font-size);
47
- line-height: var(--confirmation-title-line-height);
48
- font-weight: var(--confirmation-title-font-weight);
49
- font-family: var(--confirmation-title-font-family);
50
- color: var(--confirmation-title-color);
51
- font-feature-settings: var(--confirmation-title-font-feature-settings);
52
- }
53
- .confirmation__phone_66h8v {
54
- margin-bottom: var(--gap-2xl);
55
- color: var(--color-light-text-primary);
45
+ .confirmation__typographyTheme_1bham {
46
+ font-size: var(--confirmation-text-font-size);
47
+ line-height: var(--confirmation-text-line-height);
48
+ font-weight: var(--confirmation-text-font-weight);
49
+ font-family: var(--confirmation-text-font-family);
50
+ color: var(--confirmation-text-color);
56
51
  }
57
- .confirmation__inputContainer_66h8v {
58
- display: flex;
59
- flex-direction: column;
52
+ .confirmation__phone_1bham {
53
+ color: var(--color-light-text-primary);
60
54
  margin-bottom: var(--gap-2xl);
61
55
  }
62
- .confirmation__compact_66h8v {
56
+ .confirmation__compact_1bham {
63
57
  margin-bottom: var(--gap-xl);
64
58
  }
65
- .confirmation__loaderWrap_66h8v {
59
+ .confirmation__loaderWrap_1bham {
66
60
  display: flex;
67
61
  align-items: center;
68
62
  }
69
- .confirmation__center_66h8v {
63
+ .confirmation__left_1bham {
64
+ align-items: flex-start;
65
+ }
66
+ .confirmation__center_1bham {
70
67
  align-items: center;
71
68
  text-align: center
72
69
  }
73
- .confirmation__center_66h8v .confirmation__codeInput_66h8v,
74
- .confirmation__center_66h8v .confirmation__loaderWrap_66h8v {
70
+ .confirmation__center_1bham .confirmation__loaderWrap_1bham {
75
71
  justify-content: center;
76
72
  }
77
- .confirmation__center_66h8v input {
73
+ .confirmation__center_1bham input {
78
74
  margin: 0 var(--gap-2xs);
79
75
  }
80
- .confirmation__smsComeLink_66h8v {
76
+ .confirmation__codeInput_1bham {
77
+ margin-bottom: var(--gap-s);
78
+ }
79
+ .confirmation__smsComeLink_1bham {
81
80
  font-size: 14px;
82
81
  line-height: 20px;
83
- font-weight: 400;
82
+ font-weight: 500;
84
83
  }
85
- .confirmation__countdownContainer_66h8v {
84
+ .confirmation__countdownContainer_1bham {
85
+ color: var(--color-light-text-secondary);
86
86
  margin-bottom: var(--gap-xl);
87
87
  }
88
- .confirmation__getCodeButton_66h8v {
88
+ .confirmation__countdownMobile_1bham {
89
+ margin-bottom: var(--gap-l);
90
+ }
91
+ .confirmation__countdownLoaderMobile_1bham {
92
+ margin-bottom: var(--gap-m);
93
+ }
94
+ .confirmation__getCodeButton_1bham {
89
95
  position: relative;
90
96
  top: var(--gap-2xs-neg);
91
97
  margin-bottom: var(--gap-m);
92
98
  }
93
- .confirmation__countdown_66h8v {
94
- display: flex;
99
+ .confirmation__getCodeButtonMobile_1bham {
100
+ margin-bottom: 0;
95
101
  }
96
- .confirmation__countdownTimer_66h8v {
97
- display: flex;
98
- justify-content: flex-start;
99
- min-width: 45px;
100
- margin-left: var(--gap-2xs);
102
+ .confirmation__containerInput_1bham {
103
+ min-height: 80px;
101
104
  }
@@ -5,7 +5,9 @@ import '../../../utils.js';
5
5
  import '../../../context.js';
6
6
  import '@alfalab/core-components-code-input/modern';
7
7
  import '@alfalab/core-components-link/modern';
8
- import '../../../countdown-section-7a5f6574.js';
9
- import '@alfalab/core-components-loader/modern';
8
+ import '@alfalab/core-components-typography/modern';
10
9
  import '@alfalab/core-components-button/modern';
10
+ import '../../header/component.js';
11
+ import '@alfalab/core-components-loader/modern';
12
+ import '../../../countdown-section-2212ec31.js';
11
13
  export { Initial } from './component.js';
@@ -1,3 +1,9 @@
1
- /// <reference types="react" />
2
- declare const TempBlock: () => JSX.Element;
3
- export { TempBlock };
1
+ import { FC } from 'react';
2
+ type TempBlockProps = {
3
+ /**
4
+ * Отображать в мобильной версии экран компонента
5
+ */
6
+ mobile?: boolean;
7
+ };
8
+ declare const TempBlock: FC<TempBlockProps>;
9
+ export { TempBlockProps, TempBlock };
@@ -1,12 +1,15 @@
1
1
  import React, { useContext, useEffect, Fragment } from 'react';
2
+ import cn from 'classnames';
2
3
  import { useCountdown, formatMsAsMinutes } from '../../../utils.js';
3
4
  import { ConfirmationContext } from '../../../context.js';
5
+ import { Typography } from '@alfalab/core-components-typography/modern';
6
+ import { Header } from '../../header/component.js';
4
7
  import { CountdownLoader } from '../../countdown-loader/component.js';
5
8
 
6
- var styles = {"header":"confirmation__header_1j0oe","description":"confirmation__description_1j0oe","countdownWrap":"confirmation__countdownWrap_1j0oe","loader":"confirmation__loader_1j0oe"};
9
+ var styles = {"typographyTheme":"confirmation__typographyTheme_dpv0y","description":"confirmation__description_dpv0y","countdownWrap":"confirmation__countdownWrap_dpv0y","loader":"confirmation__loader_dpv0y"};
7
10
  require('./index.css')
8
11
 
9
- const TempBlock = () => {
12
+ const TempBlock = ({ mobile }) => {
10
13
  const { texts, tempBlockDuration, onChangeScreen, onTempBlockFinished } = useContext(ConfirmationContext);
11
14
  const [timeLeft, startTimer] = useCountdown(tempBlockDuration);
12
15
  useEffect(() => {
@@ -18,9 +21,9 @@ const TempBlock = () => {
18
21
  }
19
22
  }, [timeLeft, onChangeScreen, onTempBlockFinished]);
20
23
  return (React.createElement(Fragment, null,
21
- React.createElement("h3", { className: styles.header }, texts.tempBlockTitle),
22
- React.createElement("div", { className: styles.description }, texts.tempBlockDescription),
23
- React.createElement("div", { className: styles.countdownWrap },
24
+ React.createElement(Header, { mobile: mobile }, texts.tempBlockTitle),
25
+ React.createElement(Typography.Text, { view: 'primary-medium', color: 'primary', className: cn(styles.description, { [styles.typographyTheme]: !mobile }) }, texts.tempBlockDescription),
26
+ React.createElement("div", { className: cn(styles.countdownWrap, { [styles.typographyTheme]: !mobile }) },
24
27
  React.createElement(CountdownLoader, { progress: 1 - timeLeft / tempBlockDuration, className: styles.loader }),
25
28
  formatMsAsMinutes(timeLeft))));
26
29
  };
@@ -1,7 +1,6 @@
1
- /* hash: 8p0gi */
1
+ /* hash: 6x7mg */
2
2
  :root {
3
3
  --color-light-text-primary: #0b1f35;
4
- --color-light-text-secondary: #546272;
5
4
  }
6
5
  :root {
7
6
 
@@ -13,56 +12,39 @@
13
12
  }
14
13
  :root {
15
14
  --gap-xs: 8px;
16
- --gap-xl: 24px;
17
- --gap-2xl: 32px;
18
15
  }
19
16
  :root {
20
17
  --font-family-system: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica,
21
18
  sans-serif;
22
19
  }
23
20
  :root {
24
- /* title */
25
- --confirmation-title-font-size: 22px;
26
- --confirmation-title-line-height: 26px;
27
- --confirmation-title-font-weight: 700;
28
- --confirmation-title-font-family: var(--font-family-system);
29
- --confirmation-title-color: var(--color-light-text-primary);
30
- --confirmation-title-font-feature-settings: normal;
21
+ /* desktop */
22
+
23
+ /* mobile */
31
24
 
32
25
  /* text */
33
26
  --confirmation-text-font-size: 16px;
34
27
  --confirmation-text-line-height: 24px;
35
28
  --confirmation-text-font-weight: 400;
36
29
  --confirmation-text-font-family: var(--font-family-system);
37
- --confirmation-text-color: var(--color-light-text-secondary);
38
-
39
- /* error */
30
+ --confirmation-text-color: var(--color-light-text-primary)
40
31
 
41
- /* input */
42
- }
43
- .confirmation__header_1j0oe {
44
- margin: 0;
45
- margin-bottom: var(--gap-xl);
46
- font-size: var(--confirmation-title-font-size);
47
- line-height: var(--confirmation-title-line-height);
48
- font-weight: var(--confirmation-title-font-weight);
49
- font-family: var(--confirmation-title-font-family);
50
- color: var(--confirmation-title-color);
51
- font-feature-settings: var(--confirmation-title-font-feature-settings);
32
+ /* header */
52
33
  }
53
- .confirmation__description_1j0oe {
34
+ .confirmation__typographyTheme_dpv0y {
54
35
  font-size: var(--confirmation-text-font-size);
55
36
  line-height: var(--confirmation-text-line-height);
56
37
  font-weight: var(--confirmation-text-font-weight);
57
38
  font-family: var(--confirmation-text-font-family);
58
39
  color: var(--confirmation-text-color);
59
-
60
- margin-bottom: var(--gap-2xl);
61
40
  }
62
- .confirmation__countdownWrap_1j0oe {
41
+ .confirmation__description_dpv0y {
42
+ margin-bottom: var(--gap-xs);
43
+ }
44
+ .confirmation__countdownWrap_dpv0y {
63
45
  display: flex;
64
46
  align-items: center;
65
47
  }
66
- .confirmation__loader_1j0oe {
48
+ .confirmation__loader_dpv0y {
67
49
  margin-right: var(--gap-xs);
68
50
  }
@@ -1,5 +1,8 @@
1
1
  import 'react';
2
+ import 'classnames';
2
3
  import '../../../utils.js';
3
4
  import '../../../context.js';
5
+ import '@alfalab/core-components-typography/modern';
6
+ import '../../header/component.js';
4
7
  import '../../countdown-loader/component.js';
5
8
  export { TempBlock } from './component.js';
@@ -3,6 +3,7 @@ type CountdownSectionProps = {
3
3
  codeSendHintVisible: boolean;
4
4
  timePassed: boolean;
5
5
  processing: boolean;
6
+ mobile?: boolean;
6
7
  handleSmsRetryClick: () => void;
7
8
  };
8
9
  declare const CountdownSection: FC<CountdownSectionProps>;
@@ -0,0 +1,46 @@
1
+ import React, { useContext } from 'react';
2
+ import cn from 'classnames';
3
+ import { formatMsAsMinutes } from './utils.js';
4
+ import { ConfirmationContext } from './context.js';
5
+ import { Typography } from '@alfalab/core-components-typography/modern';
6
+ import { Button } from '@alfalab/core-components-button/modern';
7
+ import { Loader } from '@alfalab/core-components-loader/modern';
8
+
9
+ var styles = {"component":"confirmation__component_1bham","typographyTheme":"confirmation__typographyTheme_1bham","phone":"confirmation__phone_1bham","compact":"confirmation__compact_1bham","loaderWrap":"confirmation__loaderWrap_1bham","left":"confirmation__left_1bham","center":"confirmation__center_1bham","codeInput":"confirmation__codeInput_1bham","smsComeLink":"confirmation__smsComeLink_1bham","countdownContainer":"confirmation__countdownContainer_1bham","countdownMobile":"confirmation__countdownMobile_1bham","countdownLoaderMobile":"confirmation__countdownLoaderMobile_1bham","getCodeButton":"confirmation__getCodeButton_1bham","getCodeButtonMobile":"confirmation__getCodeButtonMobile_1bham","containerInput":"confirmation__containerInput_1bham"};
10
+ require('./components/screens/initial/index.css')
11
+
12
+ const CountdownSection = ({ codeSendHintVisible, timePassed, processing, mobile, handleSmsRetryClick, }) => {
13
+ const { state, texts, timeLeft, blockSmsRetry } = useContext(ConfirmationContext);
14
+ if (codeSendHintVisible) {
15
+ return (React.createElement(Typography.Text, { className: cn(styles.countdownContainer, {
16
+ [styles.countdownMobile]: mobile,
17
+ [styles.typographyTheme]: !mobile,
18
+ }), view: mobile ? 'primary-small' : 'primary-medium', tag: 'div' }, texts.codeSended));
19
+ }
20
+ if (processing) {
21
+ return (React.createElement("div", { className: cn(styles.loaderWrap, styles.countdownContainer, {
22
+ [styles.countdownLoaderMobile]: mobile,
23
+ [styles.typographyTheme]: !mobile,
24
+ }) },
25
+ React.createElement(Loader, null),
26
+ React.createElement("span", { className: styles.loaderText }, state === 'CODE_CHECKING' ? texts.codeChecking : texts.codeSending)));
27
+ }
28
+ if (blockSmsRetry) {
29
+ return (React.createElement(Typography.Text, { className: cn(styles.countdownContainer, {
30
+ [styles.countdownMobile]: mobile,
31
+ [styles.typographyTheme]: !mobile,
32
+ }), view: mobile ? 'primary-small' : 'primary-medium', tag: 'div' }, texts.noAttemptsLeft));
33
+ }
34
+ if (timePassed) {
35
+ return (React.createElement(Button, { size: mobile ? 'xs' : 'xxs', view: 'secondary', onClick: handleSmsRetryClick, className: cn(styles.getCodeButton, { [styles.getCodeButtonMobile]: mobile }) }, texts.buttonRetry));
36
+ }
37
+ return (React.createElement(Typography.Text, { className: cn(styles.countdown, styles.countdownContainer, {
38
+ [styles.countdownMobile]: mobile,
39
+ [styles.typographyTheme]: !mobile,
40
+ }), view: mobile ? 'primary-small' : 'primary-medium', tag: 'div' },
41
+ texts.countdown,
42
+ " ",
43
+ formatMsAsMinutes(timeLeft)));
44
+ };
45
+
46
+ export { CountdownSection as C, styles as s };
@@ -0,0 +1 @@
1
+ export * from "./component.desktop";
@@ -0,0 +1,20 @@
1
+ import 'react';
2
+ import 'classnames';
3
+ import '@alfalab/hooks';
4
+ import './utils.js';
5
+ import './context.js';
6
+ import './types.js';
7
+ import '@alfalab/core-components-code-input/modern';
8
+ import '@alfalab/core-components-link/modern';
9
+ import '@alfalab/core-components-typography/modern';
10
+ import '@alfalab/core-components-button/modern';
11
+ import './components/header/component.js';
12
+ import '@alfalab/core-components-loader/modern';
13
+ import './countdown-section-2212ec31.js';
14
+ import './components/screens/initial/component.js';
15
+ import './components/screens/hint/component.js';
16
+ import './components/screens/fatal-error/component.js';
17
+ import './components/countdown-loader/component.js';
18
+ import './components/screens/temp-block/component.js';
19
+ import './components/base-confirmation/component.js';
20
+ export { ConfirmationDesktop } from './component.desktop.js';
package/modern/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export * from "./component";
1
+ export { ConfirmationDesktop as Confirmation, DesktopConfirmationProps as ConfirmationProps } from "./desktop";
2
+ export * from "./responsive";
2
3
  export * from "./components/index";
3
4
  export * from "./context";
4
5
  export * from "./types";
package/modern/index.js CHANGED
@@ -6,12 +6,17 @@ export { ConfirmationContext } from './context.js';
6
6
  export { defaultTexts } from './types.js';
7
7
  import '@alfalab/core-components-code-input/modern';
8
8
  import '@alfalab/core-components-link/modern';
9
- import './countdown-section-7a5f6574.js';
10
- import '@alfalab/core-components-loader/modern';
9
+ import '@alfalab/core-components-typography/modern';
11
10
  import '@alfalab/core-components-button/modern';
11
+ import './components/header/component.js';
12
+ import '@alfalab/core-components-loader/modern';
13
+ import './countdown-section-2212ec31.js';
12
14
  export { Initial } from './components/screens/initial/component.js';
13
15
  export { Hint } from './components/screens/hint/component.js';
14
16
  export { FatalError } from './components/screens/fatal-error/component.js';
15
17
  export { CountdownLoader } from './components/countdown-loader/component.js';
16
18
  export { TempBlock } from './components/screens/temp-block/component.js';
17
- export { Confirmation } from './component.js';
19
+ import './components/base-confirmation/component.js';
20
+ export { ConfirmationDesktop as Confirmation } from './component.desktop.js';
21
+ import './component.mobile.js';
22
+ export { ConfirmationResponsive } from './component.responsive.js';
@@ -0,0 +1,4 @@
1
+ /* hash: zjzyn */
2
+ .confirmation__container_wf4yk {
3
+ max-width: 288px;
4
+ }
@@ -0,0 +1 @@
1
+ export * from "./component.mobile";
@@ -0,0 +1,20 @@
1
+ import 'react';
2
+ import 'classnames';
3
+ import '@alfalab/hooks';
4
+ import './utils.js';
5
+ import './context.js';
6
+ import './types.js';
7
+ import '@alfalab/core-components-code-input/modern';
8
+ import '@alfalab/core-components-link/modern';
9
+ import '@alfalab/core-components-typography/modern';
10
+ import '@alfalab/core-components-button/modern';
11
+ import './components/header/component.js';
12
+ import '@alfalab/core-components-loader/modern';
13
+ import './countdown-section-2212ec31.js';
14
+ import './components/screens/initial/component.js';
15
+ import './components/screens/hint/component.js';
16
+ import './components/screens/fatal-error/component.js';
17
+ import './components/countdown-loader/component.js';
18
+ import './components/screens/temp-block/component.js';
19
+ import './components/base-confirmation/component.js';
20
+ export { ConfirmationMobile } from './component.mobile.js';
@@ -0,0 +1 @@
1
+ export * from "./component.responsive";
@@ -0,0 +1,22 @@
1
+ import 'react';
2
+ import 'classnames';
3
+ import '@alfalab/hooks';
4
+ import './utils.js';
5
+ import './context.js';
6
+ import './types.js';
7
+ import '@alfalab/core-components-code-input/modern';
8
+ import '@alfalab/core-components-link/modern';
9
+ import '@alfalab/core-components-typography/modern';
10
+ import '@alfalab/core-components-button/modern';
11
+ import './components/header/component.js';
12
+ import '@alfalab/core-components-loader/modern';
13
+ import './countdown-section-2212ec31.js';
14
+ import './components/screens/initial/component.js';
15
+ import './components/screens/hint/component.js';
16
+ import './components/screens/fatal-error/component.js';
17
+ import './components/countdown-loader/component.js';
18
+ import './components/screens/temp-block/component.js';
19
+ import './components/base-confirmation/component.js';
20
+ import './component.desktop.js';
21
+ import './component.mobile.js';
22
+ export { ConfirmationResponsive } from './component.responsive.js';
package/modern/types.d.ts CHANGED
@@ -8,6 +8,10 @@ type ConfirmationProps = {
8
8
  * Состояние компонента
9
9
  */
10
10
  state: ConfirmationState | string;
11
+ /**
12
+ * Мобильная версия компонента для экрана
13
+ */
14
+ mobile?: boolean;
11
15
  /**
12
16
  * Позиционирование контента
13
17
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-confirmation",
3
- "version": "12.1.3",
3
+ "version": "12.2.0",
4
4
  "description": "Sms confirmation component",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -16,10 +16,11 @@
16
16
  "dependencies": {
17
17
  "@alfalab/core-components-button": "^6.1.1",
18
18
  "@alfalab/core-components-code-input": "^2.1.1",
19
- "@alfalab/core-components-link": "^5.0.0",
19
+ "@alfalab/core-components-link": "^5.0.1",
20
20
  "@alfalab/core-components-loader": "^3.0.2",
21
+ "@alfalab/core-components-typography": "^3.0.1",
21
22
  "@alfalab/hooks": "^1.4.1",
22
- "@alfalab/icons-glyph": "^2.64.0",
23
+ "@alfalab/icons-glyph": "^2.71.0",
23
24
  "@alfalab/utils": "^1.13.2",
24
25
  "classnames": "^2.3.1"
25
26
  },
@@ -0,0 +1 @@
1
+ export * from "./component.responsive";
package/responsive.js ADDED
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ require('./component-40c9adb0.js');
6
+ require('react');
7
+ require('classnames');
8
+ require('@alfalab/hooks');
9
+ require('./utils.js');
10
+ require('./context.js');
11
+ require('./types.js');
12
+ require('@alfalab/core-components-code-input');
13
+ require('@alfalab/core-components-link');
14
+ require('@alfalab/core-components-typography');
15
+ require('@alfalab/core-components-button');
16
+ require('./components/header/component.js');
17
+ require('@alfalab/core-components-loader');
18
+ require('./countdown-section-d04caa75.js');
19
+ require('./components/screens/initial/component.js');
20
+ require('./components/screens/hint/component.js');
21
+ require('./components/screens/fatal-error/component.js');
22
+ require('./components/countdown-loader/component.js');
23
+ require('./components/screens/temp-block/component.js');
24
+ require('./component.desktop.js');
25
+ require('./component.mobile.js');
26
+ var component_responsive = require('./component.responsive.js');
27
+
28
+
29
+
30
+ exports.ConfirmationResponsive = component_responsive.ConfirmationResponsive;
package/types.d.ts CHANGED
@@ -8,6 +8,10 @@ type ConfirmationProps = {
8
8
  * Состояние компонента
9
9
  */
10
10
  state: ConfirmationState | string;
11
+ /**
12
+ * Мобильная версия компонента для экрана
13
+ */
14
+ mobile?: boolean;
11
15
  /**
12
16
  * Позиционирование контента
13
17
  */
package/component.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import { FC } from 'react';
2
- import { ConfirmationProps } from "./types";
3
- declare const Confirmation: FC<ConfirmationProps>;
4
- export { Confirmation };
@@ -1,41 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
- var cn = require('classnames');
5
- var utils = require('./utils.js');
6
- var context = require('./context.js');
7
- var coreComponentsLoader = require('@alfalab/core-components-loader');
8
- var coreComponentsButton = require('@alfalab/core-components-button');
9
-
10
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
-
12
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
- var cn__default = /*#__PURE__*/_interopDefaultLegacy(cn);
14
-
15
- var styles = {"component":"confirmation__component_66h8v","header":"confirmation__header_66h8v","phone":"confirmation__phone_66h8v","inputContainer":"confirmation__inputContainer_66h8v","compact":"confirmation__compact_66h8v","loaderWrap":"confirmation__loaderWrap_66h8v","center":"confirmation__center_66h8v","codeInput":"confirmation__codeInput_66h8v","smsComeLink":"confirmation__smsComeLink_66h8v","countdownContainer":"confirmation__countdownContainer_66h8v","getCodeButton":"confirmation__getCodeButton_66h8v","countdown":"confirmation__countdown_66h8v","countdownTimer":"confirmation__countdownTimer_66h8v"};
16
- require('./components/screens/initial/index.css')
17
-
18
- var CountdownSection = function (_a) {
19
- var codeSendHintVisible = _a.codeSendHintVisible, timePassed = _a.timePassed, processing = _a.processing, handleSmsRetryClick = _a.handleSmsRetryClick;
20
- var _b = React.useContext(context.ConfirmationContext), state = _b.state, texts = _b.texts, timeLeft = _b.timeLeft, blockSmsRetry = _b.blockSmsRetry;
21
- if (codeSendHintVisible) {
22
- return React__default['default'].createElement("div", { className: styles.countdownContainer }, texts.codeSended);
23
- }
24
- if (processing) {
25
- return (React__default['default'].createElement("div", { className: cn__default['default'](styles.loaderWrap, styles.countdownContainer) },
26
- React__default['default'].createElement(coreComponentsLoader.Loader, null),
27
- React__default['default'].createElement("span", { className: styles.loaderText }, state === 'CODE_CHECKING' ? texts.codeChecking : texts.codeSending)));
28
- }
29
- if (blockSmsRetry) {
30
- return React__default['default'].createElement("div", { className: styles.countdownContainer }, texts.noAttemptsLeft);
31
- }
32
- if (timePassed) {
33
- return (React__default['default'].createElement(coreComponentsButton.Button, { size: 'xxs', view: 'secondary', onClick: handleSmsRetryClick, className: styles.getCodeButton }, texts.buttonRetry));
34
- }
35
- return (React__default['default'].createElement("div", { className: cn__default['default'](styles.countdown, styles.countdownContainer) },
36
- texts.countdown,
37
- React__default['default'].createElement("div", { className: styles.countdownTimer }, utils.formatMsAsMinutes(timeLeft))));
38
- };
39
-
40
- exports.CountdownSection = CountdownSection;
41
- exports.styles = styles;