@alfalab/core-components-confirmation 13.0.0 → 13.1.1

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 (115) hide show
  1. package/component.desktop.js +2 -2
  2. package/component.mobile.js +3 -3
  3. package/component.responsive.js +2 -2
  4. package/components/base-confirmation/component.js +5 -4
  5. package/components/base-confirmation/index.css +2 -2
  6. package/components/base-confirmation/index.js +2 -2
  7. package/components/countdown-loader/component.js +1 -1
  8. package/components/countdown-loader/index.css +2 -2
  9. package/components/header/component.js +1 -1
  10. package/components/header/index.css +4 -4
  11. package/components/index.js +2 -2
  12. package/components/screens/fatal-error/component.js +1 -1
  13. package/components/screens/fatal-error/index.css +6 -6
  14. package/components/screens/hint/component.js +1 -1
  15. package/components/screens/hint/index.css +12 -12
  16. package/components/screens/index.js +2 -2
  17. package/components/screens/initial/component.js +13 -4
  18. package/components/screens/initial/countdown-section.js +2 -2
  19. package/components/screens/initial/index.css +17 -17
  20. package/components/screens/initial/index.js +2 -2
  21. package/components/screens/temp-block/component.js +1 -1
  22. package/components/screens/temp-block/index.css +7 -7
  23. package/context.js +1 -0
  24. package/{countdown-section-fb6524aa.js → countdown-section-9a6d1d6b.js} +3 -3
  25. package/cssm/component.desktop.js +1 -1
  26. package/cssm/component.mobile.js +1 -1
  27. package/cssm/component.responsive.js +1 -1
  28. package/cssm/components/base-confirmation/component.js +3 -2
  29. package/cssm/components/base-confirmation/index.js +1 -1
  30. package/cssm/components/index.js +1 -1
  31. package/cssm/components/screens/index.js +1 -1
  32. package/cssm/components/screens/initial/component.js +12 -3
  33. package/cssm/components/screens/initial/countdown-section.js +2 -2
  34. package/cssm/components/screens/initial/index.js +1 -1
  35. package/cssm/context.js +1 -0
  36. package/cssm/desktop.js +1 -1
  37. package/cssm/index.js +1 -1
  38. package/cssm/mobile.js +1 -1
  39. package/cssm/shared.js +1 -1
  40. package/cssm/types.d.ts +5 -1
  41. package/desktop.js +2 -2
  42. package/esm/component.desktop.js +2 -2
  43. package/esm/component.mobile.js +3 -3
  44. package/esm/component.responsive.js +2 -2
  45. package/esm/components/base-confirmation/component.js +5 -4
  46. package/esm/components/base-confirmation/index.css +2 -2
  47. package/esm/components/base-confirmation/index.js +2 -2
  48. package/esm/components/countdown-loader/component.js +1 -1
  49. package/esm/components/countdown-loader/index.css +2 -2
  50. package/esm/components/header/component.js +1 -1
  51. package/esm/components/header/index.css +4 -4
  52. package/esm/components/index.js +2 -2
  53. package/esm/components/screens/fatal-error/component.js +1 -1
  54. package/esm/components/screens/fatal-error/index.css +6 -6
  55. package/esm/components/screens/hint/component.js +1 -1
  56. package/esm/components/screens/hint/index.css +12 -12
  57. package/esm/components/screens/index.js +2 -2
  58. package/esm/components/screens/initial/component.js +13 -4
  59. package/esm/components/screens/initial/countdown-section.js +2 -2
  60. package/esm/components/screens/initial/index.css +17 -17
  61. package/esm/components/screens/initial/index.js +2 -2
  62. package/esm/components/screens/temp-block/component.js +1 -1
  63. package/esm/components/screens/temp-block/index.css +7 -7
  64. package/esm/context.js +1 -0
  65. package/esm/{countdown-section-c65cff2d.js → countdown-section-281fb6b0.js} +3 -3
  66. package/esm/desktop.js +2 -2
  67. package/esm/index.js +2 -2
  68. package/esm/mobile.css +2 -2
  69. package/esm/mobile.js +2 -2
  70. package/esm/shared.js +2 -2
  71. package/esm/types.d.ts +5 -1
  72. package/index.js +2 -2
  73. package/mobile.css +2 -2
  74. package/mobile.js +2 -2
  75. package/modern/component.desktop.js +2 -2
  76. package/modern/component.mobile.js +3 -3
  77. package/modern/component.responsive.js +2 -2
  78. package/modern/components/base-confirmation/component.js +5 -4
  79. package/modern/components/base-confirmation/index.css +2 -2
  80. package/modern/components/base-confirmation/index.js +2 -2
  81. package/modern/components/countdown-loader/component.js +1 -1
  82. package/modern/components/countdown-loader/index.css +2 -2
  83. package/modern/components/header/component.js +1 -1
  84. package/modern/components/header/index.css +4 -4
  85. package/modern/components/index.js +2 -2
  86. package/modern/components/screens/fatal-error/component.js +1 -1
  87. package/modern/components/screens/fatal-error/index.css +6 -6
  88. package/modern/components/screens/hint/component.js +1 -1
  89. package/modern/components/screens/hint/index.css +12 -12
  90. package/modern/components/screens/index.js +2 -2
  91. package/modern/components/screens/initial/component.js +13 -4
  92. package/modern/components/screens/initial/countdown-section.js +2 -2
  93. package/modern/components/screens/initial/index.css +17 -17
  94. package/modern/components/screens/initial/index.js +2 -2
  95. package/modern/components/screens/temp-block/component.js +1 -1
  96. package/modern/components/screens/temp-block/index.css +7 -7
  97. package/modern/context.js +1 -0
  98. package/modern/{countdown-section-dd4e5fe3.js → countdown-section-baf81c17.js} +3 -3
  99. package/modern/desktop.js +2 -2
  100. package/modern/index.js +2 -2
  101. package/modern/mobile.css +2 -2
  102. package/modern/mobile.js +2 -2
  103. package/modern/shared.js +2 -2
  104. package/modern/types.d.ts +5 -1
  105. package/package.json +3 -3
  106. package/shared.js +2 -2
  107. package/src/components/base-confirmation/component.tsx +2 -0
  108. package/src/components/screens/initial/component.tsx +27 -14
  109. package/src/components/screens/initial/countdown-section.tsx +2 -2
  110. package/src/context.ts +1 -0
  111. package/src/types.ts +10 -1
  112. package/types.d.ts +5 -1
  113. /package/{countdown-section-fb6524aa.d.ts → countdown-section-9a6d1d6b.d.ts} +0 -0
  114. /package/esm/{countdown-section-c65cff2d.d.ts → countdown-section-281fb6b0.d.ts} +0 -0
  115. /package/modern/{countdown-section-dd4e5fe3.d.ts → countdown-section-baf81c17.d.ts} +0 -0
@@ -8,14 +8,14 @@ import { Typography } from '@alfalab/core-components-typography/modern';
8
8
  import { usePrevious } from '@alfalab/hooks';
9
9
  import { ConfirmationContext } from '../../../context.js';
10
10
  import { Header } from '../../header/component.js';
11
- import { s as styles, C as CountdownSection } from '../../../countdown-section-dd4e5fe3.js';
11
+ import { s as styles, C as CountdownSection } from '../../../countdown-section-baf81c17.js';
12
12
  import '../../../utils.js';
13
13
  import '@alfalab/core-components-button/modern';
14
- import '@alfalab/core-components-loader/modern';
14
+ import '@alfalab/core-components-spinner/modern';
15
15
 
16
16
  const CODE_SEND_HINT_VISIBLE_DURATION = 2000;
17
17
  const Initial = ({ mobile }) => {
18
- 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);
19
19
  const prevState = usePrevious(state);
20
20
  const inputRef = useRef(null);
21
21
  const [codeSendHintVisible, setCodeSendHintVisible] = useState(false);
@@ -79,6 +79,15 @@ const Initial = ({ mobile }) => {
79
79
  }
80
80
  return false;
81
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
+ };
82
91
  const processing = ['CODE_CHECKING', 'CODE_SENDING'].includes(state);
83
92
  const timePassed = timeLeft === 0;
84
93
  const ComponentCodeInput = mobile ? CodeInputMobile : CodeInputDesktop;
@@ -89,7 +98,7 @@ const Initial = ({ mobile }) => {
89
98
  phone),
90
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 }),
91
100
  !hideCountdownSection && (React.createElement(CountdownSection, { processing: processing, timePassed: timePassed, codeSendHintVisible: codeSendHintVisible, handleSmsRetryClick: handleSmsRetryClick, mobile: mobile })),
92
- mobile ? (React.createElement(ButtonMobile, { onClick: handleSmsHintLinkClick, view: 'link', size: 'xs' }, texts.linkToHint)) : (React.createElement(Link, { onClick: handleSmsHintLinkClick, className: styles.smsComeLink, view: mobile ? 'primary' : 'secondary', pseudo: true }, texts.linkToHint))));
101
+ renderHintButton()));
93
102
  };
94
103
 
95
104
  export { Initial };
@@ -1,8 +1,8 @@
1
1
  import 'react';
2
2
  import 'classnames';
3
3
  import '@alfalab/core-components-button/modern';
4
- import '@alfalab/core-components-loader/modern';
4
+ import '@alfalab/core-components-spinner/modern';
5
5
  import '@alfalab/core-components-typography/modern';
6
6
  import '../../../context.js';
7
7
  import '../../../utils.js';
8
- export { C as CountdownSection } from '../../../countdown-section-dd4e5fe3.js';
8
+ export { C as CountdownSection } from '../../../countdown-section-baf81c17.js';
@@ -1,4 +1,4 @@
1
- /* hash: 26rxz */
1
+ /* hash: lymrr */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: #0e0e0e;
@@ -37,49 +37,49 @@
37
37
  --confirmation-text-color: var(--color-light-text-primary)
38
38
 
39
39
  /* header */
40
- } .confirmation__component_7ycwi {
40
+ } .confirmation__component_gbpu8 {
41
41
  display: flex;
42
42
  flex-direction: column;
43
- } .confirmation__typographyTheme_7ycwi.confirmation__typographyTheme_7ycwi {
43
+ } .confirmation__typographyTheme_gbpu8.confirmation__typographyTheme_gbpu8 {
44
44
  font-size: var(--confirmation-text-font-size);
45
45
  line-height: var(--confirmation-text-line-height);
46
46
  font-weight: var(--confirmation-text-font-weight);
47
47
  font-family: var(--confirmation-text-font-family);
48
48
  color: var(--confirmation-text-color);
49
- } .confirmation__phone_7ycwi.confirmation__phone_7ycwi {
49
+ } .confirmation__phone_gbpu8.confirmation__phone_gbpu8 {
50
50
  color: var(--color-light-text-primary);
51
51
  margin-bottom: var(--gap-2xl);
52
- } .confirmation__compact_7ycwi {
52
+ } .confirmation__compact_gbpu8 {
53
53
  margin-bottom: var(--gap-xl);
54
- } .confirmation__loaderWrap_7ycwi {
54
+ } .confirmation__loaderWrap_gbpu8 {
55
55
  display: flex;
56
56
  align-items: center;
57
- } .confirmation__left_7ycwi {
57
+ } .confirmation__left_gbpu8 {
58
58
  align-items: flex-start;
59
- } .confirmation__center_7ycwi {
59
+ } .confirmation__center_gbpu8 {
60
60
  align-items: center;
61
61
  text-align: center
62
- } .confirmation__center_7ycwi .confirmation__loaderWrap_7ycwi {
62
+ } .confirmation__center_gbpu8 .confirmation__loaderWrap_gbpu8 {
63
63
  justify-content: center;
64
- } .confirmation__codeInput_7ycwi {
64
+ } .confirmation__codeInput_gbpu8 {
65
65
  margin-bottom: var(--gap-s);
66
- } .confirmation__smsComeLink_7ycwi.confirmation__smsComeLink_7ycwi {
66
+ } .confirmation__smsComeLink_gbpu8.confirmation__smsComeLink_gbpu8 {
67
67
  font-size: 14px;
68
68
  line-height: 20px;
69
69
  font-weight: 500;
70
- } .confirmation__countdownContainer_7ycwi.confirmation__countdownContainer_7ycwi {
70
+ } .confirmation__countdownContainer_gbpu8.confirmation__countdownContainer_gbpu8 {
71
71
  color: var(--color-light-text-secondary);
72
72
  margin-bottom: var(--gap-xl);
73
- } .confirmation__countdownMobile_7ycwi.confirmation__countdownMobile_7ycwi {
73
+ } .confirmation__countdownMobile_gbpu8.confirmation__countdownMobile_gbpu8 {
74
74
  margin-bottom: var(--gap-l);
75
- } .confirmation__countdownLoaderMobile_7ycwi.confirmation__countdownLoaderMobile_7ycwi {
75
+ } .confirmation__countdownLoaderMobile_gbpu8.confirmation__countdownLoaderMobile_gbpu8 {
76
76
  margin-bottom: var(--gap-m);
77
- } .confirmation__getCodeButton_7ycwi {
77
+ } .confirmation__getCodeButton_gbpu8 {
78
78
  position: relative;
79
79
  top: var(--gap-2xs-neg);
80
80
  margin-bottom: var(--gap-m);
81
- } .confirmation__getCodeButtonMobile_7ycwi {
81
+ } .confirmation__getCodeButtonMobile_gbpu8 {
82
82
  margin-bottom: 0;
83
- } .confirmation__containerInput_7ycwi {
83
+ } .confirmation__containerInput_gbpu8 {
84
84
  min-height: 80px;
85
85
  }
@@ -10,6 +10,6 @@ import '@alfalab/hooks';
10
10
  import '../../../context.js';
11
11
  import '../../../utils.js';
12
12
  import '../../header/component.js';
13
- import '../../../countdown-section-dd4e5fe3.js';
13
+ import '../../../countdown-section-baf81c17.js';
14
14
  import '@alfalab/core-components-button/modern';
15
- import '@alfalab/core-components-loader/modern';
15
+ import '@alfalab/core-components-spinner/modern';
@@ -6,7 +6,7 @@ import { useCountdown, formatMsAsMinutes } from '../../../utils.js';
6
6
  import { CountdownLoader } from '../../countdown-loader/component.js';
7
7
  import { Header } from '../../header/component.js';
8
8
 
9
- const styles = {"component":"confirmation__component_mzsf9","center":"confirmation__center_mzsf9","typographyTheme":"confirmation__typographyTheme_mzsf9","description":"confirmation__description_mzsf9","countdownWrap":"confirmation__countdownWrap_mzsf9","loader":"confirmation__loader_mzsf9"};
9
+ const styles = {"component":"confirmation__component_f0ffk","center":"confirmation__center_f0ffk","typographyTheme":"confirmation__typographyTheme_f0ffk","description":"confirmation__description_f0ffk","countdownWrap":"confirmation__countdownWrap_f0ffk","loader":"confirmation__loader_f0ffk"};
10
10
  require('./index.css')
11
11
 
12
12
  const TempBlock = ({ mobile }) => {
@@ -1,4 +1,4 @@
1
- /* hash: s6hbt */
1
+ /* hash: 1dast */
2
2
  :root {
3
3
  } /* deprecated */ :root {
4
4
  --color-light-text-primary: #0e0e0e; /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */ /* deprecated */
@@ -31,23 +31,23 @@
31
31
  --confirmation-text-color: var(--color-light-text-primary)
32
32
 
33
33
  /* header */
34
- } .confirmation__component_mzsf9 {
34
+ } .confirmation__component_f0ffk {
35
35
  display: flex;
36
36
  flex-direction: column;
37
- } .confirmation__center_mzsf9 {
37
+ } .confirmation__center_f0ffk {
38
38
  align-items: center;
39
39
  text-align: center;
40
- } .confirmation__typographyTheme_mzsf9.confirmation__typographyTheme_mzsf9 {
40
+ } .confirmation__typographyTheme_f0ffk.confirmation__typographyTheme_f0ffk {
41
41
  font-size: var(--confirmation-text-font-size);
42
42
  line-height: var(--confirmation-text-line-height);
43
43
  font-weight: var(--confirmation-text-font-weight);
44
44
  font-family: var(--confirmation-text-font-family);
45
45
  color: var(--confirmation-text-color);
46
- } .confirmation__description_mzsf9.confirmation__description_mzsf9 {
46
+ } .confirmation__description_f0ffk.confirmation__description_f0ffk {
47
47
  margin-bottom: var(--gap-xs);
48
- } .confirmation__countdownWrap_mzsf9 {
48
+ } .confirmation__countdownWrap_f0ffk {
49
49
  display: flex;
50
50
  align-items: center;
51
- } .confirmation__loader_mzsf9 {
51
+ } .confirmation__loader_f0ffk {
52
52
  margin-right: var(--gap-xs);
53
53
  }
package/modern/context.js CHANGED
@@ -14,6 +14,7 @@ const ConfirmationContext = createContext({
14
14
  phone: '',
15
15
  hideCountdownSection: false,
16
16
  breakpoint: 1024,
17
+ initialScreenHintSlot: null,
17
18
  onTempBlockFinished: mockFn,
18
19
  onInputFinished: mockFn,
19
20
  onChangeState: mockFn,
@@ -1,12 +1,12 @@
1
1
  import React, { useContext } from 'react';
2
2
  import cn from 'classnames';
3
3
  import { Button } from '@alfalab/core-components-button/modern';
4
- import { Loader } from '@alfalab/core-components-loader/modern';
4
+ import { Spinner } from '@alfalab/core-components-spinner/modern';
5
5
  import { Typography } from '@alfalab/core-components-typography/modern';
6
6
  import { ConfirmationContext } from './context.js';
7
7
  import { formatMsAsMinutes } from './utils.js';
8
8
 
9
- const styles = {"component":"confirmation__component_7ycwi","typographyTheme":"confirmation__typographyTheme_7ycwi","phone":"confirmation__phone_7ycwi","compact":"confirmation__compact_7ycwi","loaderWrap":"confirmation__loaderWrap_7ycwi","left":"confirmation__left_7ycwi","center":"confirmation__center_7ycwi","codeInput":"confirmation__codeInput_7ycwi","smsComeLink":"confirmation__smsComeLink_7ycwi","countdownContainer":"confirmation__countdownContainer_7ycwi","countdownMobile":"confirmation__countdownMobile_7ycwi","countdownLoaderMobile":"confirmation__countdownLoaderMobile_7ycwi","getCodeButton":"confirmation__getCodeButton_7ycwi","getCodeButtonMobile":"confirmation__getCodeButtonMobile_7ycwi","containerInput":"confirmation__containerInput_7ycwi"};
9
+ const styles = {"component":"confirmation__component_gbpu8","typographyTheme":"confirmation__typographyTheme_gbpu8","phone":"confirmation__phone_gbpu8","compact":"confirmation__compact_gbpu8","loaderWrap":"confirmation__loaderWrap_gbpu8","left":"confirmation__left_gbpu8","center":"confirmation__center_gbpu8","codeInput":"confirmation__codeInput_gbpu8","smsComeLink":"confirmation__smsComeLink_gbpu8","countdownContainer":"confirmation__countdownContainer_gbpu8","countdownMobile":"confirmation__countdownMobile_gbpu8","countdownLoaderMobile":"confirmation__countdownLoaderMobile_gbpu8","getCodeButton":"confirmation__getCodeButton_gbpu8","getCodeButtonMobile":"confirmation__getCodeButtonMobile_gbpu8","containerInput":"confirmation__containerInput_gbpu8"};
10
10
  require('./components/screens/initial/index.css')
11
11
 
12
12
  const CountdownSection = ({ codeSendHintVisible, timePassed, processing, mobile, handleSmsRetryClick, }) => {
@@ -22,7 +22,7 @@ const CountdownSection = ({ codeSendHintVisible, timePassed, processing, mobile,
22
22
  [styles.countdownLoaderMobile]: mobile,
23
23
  [styles.typographyTheme]: !mobile,
24
24
  }) },
25
- React.createElement(Loader, null),
25
+ React.createElement(Spinner, { visible: true }),
26
26
  React.createElement("span", { className: styles.loaderText }, state === 'CODE_CHECKING' ? texts.codeChecking : texts.codeSending)));
27
27
  }
28
28
  if (blockSmsRetry)
package/modern/desktop.js CHANGED
@@ -13,9 +13,9 @@ import '@alfalab/core-components-code-input/modern/mobile';
13
13
  import '@alfalab/core-components-link/modern';
14
14
  import '@alfalab/core-components-typography/modern';
15
15
  import './components/header/component.js';
16
- import './countdown-section-dd4e5fe3.js';
16
+ import './countdown-section-baf81c17.js';
17
17
  import '@alfalab/core-components-button/modern';
18
- import '@alfalab/core-components-loader/modern';
18
+ import '@alfalab/core-components-spinner/modern';
19
19
  import './components/screens/hint/component.js';
20
20
  import './components/screens/fatal-error/component.js';
21
21
  import './components/screens/temp-block/component.js';
package/modern/index.js CHANGED
@@ -15,9 +15,9 @@ import '@alfalab/core-components-code-input/modern/mobile';
15
15
  import '@alfalab/core-components-link/modern';
16
16
  import '@alfalab/core-components-typography/modern';
17
17
  import './components/header/component.js';
18
- import './countdown-section-dd4e5fe3.js';
18
+ import './countdown-section-baf81c17.js';
19
19
  import '@alfalab/core-components-button/modern';
20
- import '@alfalab/core-components-loader/modern';
20
+ import '@alfalab/core-components-spinner/modern';
21
21
  import './components/screens/hint/component.js';
22
22
  import './components/screens/fatal-error/component.js';
23
23
  import './components/screens/temp-block/component.js';
package/modern/mobile.css CHANGED
@@ -1,4 +1,4 @@
1
- /* hash: pdq5h */
2
- .confirmation__container_hgizz {
1
+ /* hash: 6wh3t */
2
+ .confirmation__container_gsnsg {
3
3
  max-width: 288px;
4
4
  }
package/modern/mobile.js CHANGED
@@ -13,9 +13,9 @@ import '@alfalab/core-components-code-input/modern/mobile';
13
13
  import '@alfalab/core-components-link/modern';
14
14
  import '@alfalab/core-components-typography/modern';
15
15
  import './components/header/component.js';
16
- import './countdown-section-dd4e5fe3.js';
16
+ import './countdown-section-baf81c17.js';
17
17
  import '@alfalab/core-components-button/modern';
18
- import '@alfalab/core-components-loader/modern';
18
+ import '@alfalab/core-components-spinner/modern';
19
19
  import './components/screens/hint/component.js';
20
20
  import './components/screens/fatal-error/component.js';
21
21
  import './components/screens/temp-block/component.js';
package/modern/shared.js CHANGED
@@ -15,6 +15,6 @@ import '@alfalab/core-components-link/modern';
15
15
  import '@alfalab/core-components-typography/modern';
16
16
  import '@alfalab/hooks';
17
17
  import './components/header/component.js';
18
- import './countdown-section-dd4e5fe3.js';
18
+ import './countdown-section-baf81c17.js';
19
19
  import '@alfalab/core-components-button/modern';
20
- import '@alfalab/core-components-loader/modern';
20
+ import '@alfalab/core-components-spinner/modern';
package/modern/types.d.ts CHANGED
@@ -89,13 +89,17 @@ type ConfirmationProps = {
89
89
  * @default false
90
90
  */
91
91
  hideCountdownSection?: boolean;
92
+ /**
93
+ * Слот для контента с подсказкой на главном экране
94
+ */
95
+ initialScreenHintSlot?: ReactNode;
92
96
  /**
93
97
  * Контрольная точка для кнопки, с нее начинается desktop версия
94
98
  * @default 1024
95
99
  */
96
100
  breakpoint?: number;
97
101
  };
98
- 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'> & {
99
103
  timeLeft: number;
100
104
  } & {
101
105
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-confirmation",
3
- "version": "13.0.0",
3
+ "version": "13.1.1",
4
4
  "description": "Sms confirmation component",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -35,10 +35,10 @@
35
35
  "directory": "dist"
36
36
  },
37
37
  "dependencies": {
38
- "@alfalab/core-components-button": "^9.0.0",
38
+ "@alfalab/core-components-button": "^9.0.2",
39
39
  "@alfalab/core-components-code-input": "^3.0.0",
40
40
  "@alfalab/core-components-link": "^5.1.0",
41
- "@alfalab/core-components-loader": "^3.1.0",
41
+ "@alfalab/core-components-spinner": "^3.1.0",
42
42
  "@alfalab/core-components-typography": "^4.0.0",
43
43
  "@alfalab/core-components-mq": "^4.2.0",
44
44
  "@alfalab/hooks": "^1.13.0",
package/shared.js CHANGED
@@ -19,9 +19,9 @@ require('@alfalab/core-components-link');
19
19
  require('@alfalab/core-components-typography');
20
20
  require('@alfalab/hooks');
21
21
  require('./components/header/component.js');
22
- require('./countdown-section-fb6524aa.js');
22
+ require('./countdown-section-9a6d1d6b.js');
23
23
  require('@alfalab/core-components-button');
24
- require('@alfalab/core-components-loader');
24
+ require('@alfalab/core-components-spinner');
25
25
 
26
26
 
27
27
 
@@ -40,6 +40,7 @@ export const BaseConfirmation: FC<ConfirmationProps> = ({
40
40
  clearCodeOnError = true,
41
41
  hideCountdownSection = false,
42
42
  breakpoint = 1024,
43
+ initialScreenHintSlot,
43
44
  ...restProps
44
45
  }) => {
45
46
  const [timeLeft, startTimer, stopTimer] = useCountdown(countdownDuration);
@@ -104,6 +105,7 @@ export const BaseConfirmation: FC<ConfirmationProps> = ({
104
105
  onChangeState,
105
106
  onChangeScreen,
106
107
  clearCodeOnError,
108
+ initialScreenHintSlot,
107
109
  onInputFinished: handleInputFinished,
108
110
  onSmsRetryClick: handleSmsRetry,
109
111
  onFatalErrorOkButtonClick: handleFatalErrorOkButtonClick,
@@ -43,6 +43,7 @@ export const Initial: FC<InitialProps> = ({ mobile }) => {
43
43
  phone,
44
44
  clearCodeOnError,
45
45
  hideCountdownSection,
46
+ initialScreenHintSlot,
46
47
  onChangeState,
47
48
  onInputFinished,
48
49
  onChangeScreen,
@@ -133,6 +134,31 @@ export const Initial: FC<InitialProps> = ({ mobile }) => {
133
134
  return false;
134
135
  };
135
136
 
137
+ const renderHintButton = () => {
138
+ if (initialScreenHintSlot) {
139
+ return initialScreenHintSlot;
140
+ }
141
+
142
+ if (mobile) {
143
+ return (
144
+ <ButtonMobile onClick={handleSmsHintLinkClick} view='link' size='xs'>
145
+ {texts.linkToHint}
146
+ </ButtonMobile>
147
+ );
148
+ }
149
+
150
+ return (
151
+ <Link
152
+ onClick={handleSmsHintLinkClick}
153
+ className={styles.smsComeLink}
154
+ view={mobile ? 'primary' : 'secondary'}
155
+ pseudo={true}
156
+ >
157
+ {texts.linkToHint}
158
+ </Link>
159
+ );
160
+ };
161
+
136
162
  const processing = ['CODE_CHECKING', 'CODE_SENDING'].includes(state);
137
163
 
138
164
  const timePassed = timeLeft === 0;
@@ -171,20 +197,7 @@ export const Initial: FC<InitialProps> = ({ mobile }) => {
171
197
  />
172
198
  )}
173
199
 
174
- {mobile ? (
175
- <ButtonMobile onClick={handleSmsHintLinkClick} view='link' size='xs'>
176
- {texts.linkToHint}
177
- </ButtonMobile>
178
- ) : (
179
- <Link
180
- onClick={handleSmsHintLinkClick}
181
- className={styles.smsComeLink}
182
- view={mobile ? 'primary' : 'secondary'}
183
- pseudo={true}
184
- >
185
- {texts.linkToHint}
186
- </Link>
187
- )}
200
+ {renderHintButton()}
188
201
  </div>
189
202
  );
190
203
  };
@@ -2,7 +2,7 @@ import React, { FC, useContext } from 'react';
2
2
  import cn from 'classnames';
3
3
 
4
4
  import { Button } from '@alfalab/core-components-button';
5
- import { Loader } from '@alfalab/core-components-loader';
5
+ import { Spinner } from '@alfalab/core-components-spinner';
6
6
  import { Typography } from '@alfalab/core-components-typography';
7
7
 
8
8
  import { ConfirmationContext } from '../../../context';
@@ -50,7 +50,7 @@ export const CountdownSection: FC<CountdownSectionProps> = ({
50
50
  [styles.typographyTheme]: !mobile,
51
51
  })}
52
52
  >
53
- <Loader />
53
+ <Spinner visible={true} />
54
54
 
55
55
  <span className={styles.loaderText}>
56
56
  {state === 'CODE_CHECKING' ? texts.codeChecking : texts.codeSending}
package/src/context.ts CHANGED
@@ -17,6 +17,7 @@ export const ConfirmationContext = createContext<TConfirmationContext>({
17
17
  phone: '',
18
18
  hideCountdownSection: false,
19
19
  breakpoint: 1024,
20
+ initialScreenHintSlot: null,
20
21
  onTempBlockFinished: mockFn,
21
22
  onInputFinished: mockFn,
22
23
  onChangeState: mockFn,
package/src/types.ts CHANGED
@@ -112,6 +112,11 @@ export type ConfirmationProps = {
112
112
  */
113
113
  hideCountdownSection?: boolean;
114
114
 
115
+ /**
116
+ * Слот для контента с подсказкой на главном экране
117
+ */
118
+ initialScreenHintSlot?: ReactNode;
119
+
115
120
  /**
116
121
  * Контрольная точка для кнопки, с нее начинается desktop версия
117
122
  * @default 1024
@@ -139,7 +144,11 @@ export type TConfirmationContext = Required<
139
144
  > &
140
145
  Pick<
141
146
  ConfirmationProps,
142
- 'phone' | 'blockSmsRetry' | 'onTempBlockFinished' | 'clearCodeOnError'
147
+ | 'phone'
148
+ | 'blockSmsRetry'
149
+ | 'onTempBlockFinished'
150
+ | 'clearCodeOnError'
151
+ | 'initialScreenHintSlot'
143
152
  > & {
144
153
  timeLeft: number;
145
154
  } & {
package/types.d.ts CHANGED
@@ -89,13 +89,17 @@ type ConfirmationProps = {
89
89
  * @default false
90
90
  */
91
91
  hideCountdownSection?: boolean;
92
+ /**
93
+ * Слот для контента с подсказкой на главном экране
94
+ */
95
+ initialScreenHintSlot?: ReactNode;
92
96
  /**
93
97
  * Контрольная точка для кнопки, с нее начинается desktop версия
94
98
  * @default 1024
95
99
  */
96
100
  breakpoint?: number;
97
101
  };
98
- 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'> & {
99
103
  timeLeft: number;
100
104
  } & {
101
105
  /**