@alfalab/core-components-confirmation 13.8.2 → 13.8.3

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 (93) hide show
  1. package/component.responsive.d.ts +5 -0
  2. package/component.responsive.js +2 -3
  3. package/components/base-confirmation/component.js +4 -4
  4. package/components/base-confirmation/index.css +2 -2
  5. package/components/countdown-loader/component.js +1 -1
  6. package/components/countdown-loader/index.css +2 -2
  7. package/components/header/component.js +1 -1
  8. package/components/header/index.css +4 -4
  9. package/components/screens/fatal-error/component.js +3 -3
  10. package/components/screens/fatal-error/index.css +7 -7
  11. package/components/screens/hint/component.js +3 -3
  12. package/components/screens/hint/index.css +13 -13
  13. package/components/screens/initial/component.js +1 -1
  14. package/components/screens/initial/countdown-section.js +1 -1
  15. package/components/screens/initial/index.css +19 -19
  16. package/components/screens/temp-block/component.js +1 -1
  17. package/components/screens/temp-block/index.css +8 -8
  18. package/context.js +1 -0
  19. package/{countdown-section-b633717a.js → countdown-section-0f785844.js} +4 -4
  20. package/cssm/component.responsive.d.ts +5 -0
  21. package/cssm/component.responsive.js +2 -3
  22. package/cssm/components/base-confirmation/component.js +3 -3
  23. package/cssm/components/screens/fatal-error/component.js +2 -2
  24. package/cssm/components/screens/hint/component.js +2 -2
  25. package/cssm/components/screens/initial/countdown-section.js +3 -3
  26. package/cssm/context.js +1 -0
  27. package/cssm/types.d.ts +5 -7
  28. package/esm/component.responsive.d.ts +5 -0
  29. package/esm/component.responsive.js +3 -4
  30. package/esm/components/base-confirmation/component.js +4 -4
  31. package/esm/components/base-confirmation/index.css +2 -2
  32. package/esm/components/countdown-loader/component.js +1 -1
  33. package/esm/components/countdown-loader/index.css +2 -2
  34. package/esm/components/header/component.js +1 -1
  35. package/esm/components/header/index.css +4 -4
  36. package/esm/components/screens/fatal-error/component.js +3 -3
  37. package/esm/components/screens/fatal-error/index.css +7 -7
  38. package/esm/components/screens/hint/component.js +3 -3
  39. package/esm/components/screens/hint/index.css +13 -13
  40. package/esm/components/screens/initial/component.js +1 -1
  41. package/esm/components/screens/initial/countdown-section.js +1 -1
  42. package/esm/components/screens/initial/index.css +19 -19
  43. package/esm/components/screens/temp-block/component.js +1 -1
  44. package/esm/components/screens/temp-block/index.css +8 -8
  45. package/esm/context.js +1 -0
  46. package/esm/{countdown-section-88d8eded.js → countdown-section-3516a8a6.js} +4 -4
  47. package/esm/mobile/component.mobile.js +1 -1
  48. package/esm/mobile/mobile.css +2 -2
  49. package/esm/types.d.ts +5 -7
  50. package/mobile/component.mobile.js +1 -1
  51. package/mobile/mobile.css +2 -2
  52. package/modern/component.responsive.d.ts +5 -0
  53. package/modern/component.responsive.js +3 -4
  54. package/modern/components/base-confirmation/component.js +3 -3
  55. package/modern/components/base-confirmation/index.css +2 -2
  56. package/modern/components/countdown-loader/component.js +1 -1
  57. package/modern/components/countdown-loader/index.css +2 -2
  58. package/modern/components/header/component.js +1 -1
  59. package/modern/components/header/index.css +4 -4
  60. package/modern/components/screens/fatal-error/component.js +3 -3
  61. package/modern/components/screens/fatal-error/index.css +7 -7
  62. package/modern/components/screens/hint/component.js +3 -3
  63. package/modern/components/screens/hint/index.css +13 -13
  64. package/modern/components/screens/initial/component.js +1 -1
  65. package/modern/components/screens/initial/countdown-section.js +1 -1
  66. package/modern/components/screens/initial/index.css +19 -19
  67. package/modern/components/screens/temp-block/component.js +1 -1
  68. package/modern/components/screens/temp-block/index.css +8 -8
  69. package/modern/context.js +1 -0
  70. package/modern/{countdown-section-9cd2a918.js → countdown-section-7563320f.js} +4 -4
  71. package/modern/mobile/component.mobile.js +1 -1
  72. package/modern/mobile/mobile.css +2 -2
  73. package/modern/types.d.ts +5 -7
  74. package/moderncssm/component.responsive.d.ts +5 -0
  75. package/moderncssm/component.responsive.js +3 -4
  76. package/moderncssm/components/base-confirmation/component.js +2 -2
  77. package/moderncssm/components/screens/fatal-error/component.js +2 -2
  78. package/moderncssm/components/screens/hint/component.js +2 -2
  79. package/moderncssm/components/screens/initial/countdown-section.js +3 -3
  80. package/moderncssm/context.js +1 -0
  81. package/moderncssm/types.d.ts +5 -7
  82. package/package.json +5 -5
  83. package/src/component.responsive.tsx +11 -5
  84. package/src/components/base-confirmation/component.tsx +3 -2
  85. package/src/components/screens/fatal-error/component.tsx +2 -1
  86. package/src/components/screens/hint/component.tsx +2 -1
  87. package/src/components/screens/initial/countdown-section.tsx +4 -2
  88. package/src/context.ts +1 -0
  89. package/src/types.ts +7 -6
  90. package/types.d.ts +5 -7
  91. /package/{countdown-section-b633717a.d.ts → countdown-section-0f785844.d.ts} +0 -0
  92. /package/esm/{countdown-section-88d8eded.d.ts → countdown-section-3516a8a6.d.ts} +0 -0
  93. /package/modern/{countdown-section-9cd2a918.d.ts → countdown-section-7563320f.d.ts} +0 -0
@@ -17,7 +17,7 @@ export type FatalErrorProps = {
17
17
  };
18
18
 
19
19
  export const FatalError: FC<FatalErrorProps> = ({ mobile }) => {
20
- const { alignContent, texts, onFatalErrorOkButtonClick, breakpoint } =
20
+ const { alignContent, texts, onFatalErrorOkButtonClick, breakpoint, client } =
21
21
  useContext(ConfirmationContext);
22
22
 
23
23
  return (
@@ -41,6 +41,7 @@ export const FatalError: FC<FatalErrorProps> = ({ mobile }) => {
41
41
  onClick={onFatalErrorOkButtonClick}
42
42
  className={styles.button}
43
43
  breakpoint={breakpoint}
44
+ client={client}
44
45
  >
45
46
  {texts.fatalErrorButton}
46
47
  </Button>
@@ -18,7 +18,7 @@ export type HintProps = {
18
18
  };
19
19
 
20
20
  export const Hint: FC<HintProps> = ({ mobile }) => {
21
- const { alignContent, texts, onChangeScreen, onChangeState, breakpoint } =
21
+ const { alignContent, texts, onChangeScreen, onChangeState, breakpoint, client } =
22
22
  useContext(ConfirmationContext);
23
23
 
24
24
  const handleReturnButtonClick = () => {
@@ -110,6 +110,7 @@ export const Hint: FC<HintProps> = ({ mobile }) => {
110
110
  onClick={handleReturnButtonClick}
111
111
  className={styles.hintButton}
112
112
  breakpoint={breakpoint}
113
+ client={client}
113
114
  >
114
115
  {texts.hintButton}
115
116
  </Button>
@@ -25,7 +25,8 @@ export const CountdownSection: FC<CountdownSectionProps> = ({
25
25
  mobile,
26
26
  handleSmsRetryClick,
27
27
  }) => {
28
- const { state, texts, timeLeft, blockSmsRetry, breakpoint } = useContext(ConfirmationContext);
28
+ const { state, texts, timeLeft, blockSmsRetry, breakpoint, client } =
29
+ useContext(ConfirmationContext);
29
30
 
30
31
  const renderText = (text?: string) => (
31
32
  <Typography.Text
@@ -50,7 +51,7 @@ export const CountdownSection: FC<CountdownSectionProps> = ({
50
51
  [styles.typographyTheme]: !mobile,
51
52
  })}
52
53
  >
53
- <Spinner visible={true} />
54
+ <Spinner preset={24} visible={true} />
54
55
 
55
56
  <span className={styles.loaderText}>
56
57
  {state === 'CODE_CHECKING' ? texts.codeChecking : texts.codeSending}
@@ -69,6 +70,7 @@ export const CountdownSection: FC<CountdownSectionProps> = ({
69
70
  onClick={handleSmsRetryClick}
70
71
  className={cn(styles.getCodeButton, { [styles.getCodeButtonMobile]: mobile })}
71
72
  breakpoint={breakpoint}
73
+ client={client}
72
74
  >
73
75
  {texts.buttonRetry}
74
76
  </Button>
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
+ client: 'desktop',
20
21
  initialScreenHintSlot: null,
21
22
  onTempBlockFinished: mockFn,
22
23
  onInputFinished: mockFn,
package/src/types.ts CHANGED
@@ -123,6 +123,11 @@ export type ConfirmationProps = {
123
123
  */
124
124
  breakpoint?: number;
125
125
 
126
+ /**
127
+ * Версия, которая будет использоваться при серверном рендеринге
128
+ */
129
+ client?: 'desktop' | 'mobile';
130
+
126
131
  /**
127
132
  * Продолжительность отображения ошибки
128
133
  * @default 1300
@@ -156,14 +161,10 @@ export type TConfirmationContext = Required<
156
161
  | 'clearCodeOnError'
157
162
  | 'initialScreenHintSlot'
158
163
  | 'errorVisibleDuration'
164
+ | 'breakpoint'
165
+ | 'client'
159
166
  > & {
160
167
  timeLeft: number;
161
- } & {
162
- /**
163
- * Контрольная точка для кнопки, с нее начинается desktop версия
164
- * @default 1024
165
- */
166
- breakpoint?: number;
167
168
  };
168
169
 
169
170
  export type ConfirmationTexts = {
package/types.d.ts CHANGED
@@ -98,20 +98,18 @@ type ConfirmationProps = {
98
98
  * @default 1024
99
99
  */
100
100
  breakpoint?: number;
101
+ /**
102
+ * Версия, которая будет использоваться при серверном рендеринге
103
+ */
104
+ client?: 'desktop' | 'mobile';
101
105
  /**
102
106
  * Продолжительность отображения ошибки
103
107
  * @default 1300
104
108
  */
105
109
  errorVisibleDuration?: number;
106
110
  };
107
- 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' | 'errorVisibleDuration'> & {
111
+ 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' | 'errorVisibleDuration' | 'breakpoint' | 'client'> & {
108
112
  timeLeft: number;
109
- } & {
110
- /**
111
- * Контрольная точка для кнопки, с нее начинается desktop версия
112
- * @default 1024
113
- */
114
- breakpoint?: number;
115
113
  };
116
114
  type ConfirmationTexts = {
117
115
  /**