@alfalab/core-components-confirmation 14.0.1 → 14.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 (284) hide show
  1. package/component.responsive.d.ts +2 -2
  2. package/component.responsive.js.map +1 -1
  3. package/components/base-confirmation/component.d.ts +2 -2
  4. package/components/base-confirmation/component.js +4 -3
  5. package/components/base-confirmation/component.js.map +1 -1
  6. package/components/base-confirmation/index.css +3 -3
  7. package/components/base-confirmation/index.module.css.js +1 -1
  8. package/components/base-confirmation/index.module.css.js.map +1 -1
  9. package/components/countdown-loader/component.d.ts +1 -1
  10. package/components/countdown-loader/component.js.map +1 -1
  11. package/components/countdown-loader/index.css +1 -1
  12. package/components/countdown-loader/index.module.css.js +1 -1
  13. package/components/countdown-loader/index.module.css.js.map +1 -1
  14. package/components/header/component.d.ts +6 -1
  15. package/components/header/component.js +2 -2
  16. package/components/header/component.js.map +1 -1
  17. package/components/header/index.css +5 -5
  18. package/components/header/index.module.css.js +1 -1
  19. package/components/screens/fatal-error/component.d.ts +1 -1
  20. package/components/screens/fatal-error/component.js +2 -2
  21. package/components/screens/fatal-error/component.js.map +1 -1
  22. package/components/screens/fatal-error/index.css +8 -10
  23. package/components/screens/fatal-error/index.module.css.js +1 -1
  24. package/components/screens/hint/component.d.ts +1 -1
  25. package/components/screens/hint/component.js +2 -2
  26. package/components/screens/hint/component.js.map +1 -1
  27. package/components/screens/hint/index.css +16 -18
  28. package/components/screens/hint/index.module.css.js +1 -1
  29. package/components/screens/initial/component.d.ts +1 -1
  30. package/components/screens/initial/component.js +2 -2
  31. package/components/screens/initial/component.js.map +1 -1
  32. package/components/screens/initial/countdown-section.d.ts +1 -1
  33. package/components/screens/initial/countdown-section.js.map +1 -1
  34. package/components/screens/initial/index.css +22 -24
  35. package/components/screens/initial/index.module.css.js +1 -1
  36. package/components/screens/temp-block/component.d.ts +1 -1
  37. package/components/screens/temp-block/component.js +2 -2
  38. package/components/screens/temp-block/component.js.map +1 -1
  39. package/components/screens/temp-block/index.css +10 -12
  40. package/components/screens/temp-block/index.module.css.js +1 -1
  41. package/components/screens/temp-block-over/component.d.ts +1 -1
  42. package/components/screens/temp-block-over/component.js +2 -2
  43. package/components/screens/temp-block-over/component.js.map +1 -1
  44. package/components/screens/temp-block-over/index.css +7 -9
  45. package/components/screens/temp-block-over/index.module.css.js +1 -1
  46. package/context.d.ts +1 -1
  47. package/context.js +1 -0
  48. package/context.js.map +1 -1
  49. package/cssm/component.responsive.d.ts +2 -2
  50. package/cssm/component.responsive.js.map +1 -1
  51. package/cssm/components/base-confirmation/component.d.ts +2 -2
  52. package/cssm/components/base-confirmation/component.js +4 -3
  53. package/cssm/components/base-confirmation/component.js.map +1 -1
  54. package/cssm/components/base-confirmation/index.module.css +1 -1
  55. package/cssm/components/countdown-loader/component.d.ts +1 -1
  56. package/cssm/components/countdown-loader/component.js.map +1 -1
  57. package/cssm/components/header/component.d.ts +6 -1
  58. package/cssm/components/header/component.js +2 -2
  59. package/cssm/components/header/component.js.map +1 -1
  60. package/cssm/components/header/index.module.css +2 -2
  61. package/cssm/components/screens/fatal-error/component.d.ts +1 -1
  62. package/cssm/components/screens/fatal-error/component.js +2 -2
  63. package/cssm/components/screens/fatal-error/component.js.map +1 -1
  64. package/cssm/components/screens/fatal-error/index.module.css +2 -4
  65. package/cssm/components/screens/hint/component.d.ts +1 -1
  66. package/cssm/components/screens/hint/component.js +2 -2
  67. package/cssm/components/screens/hint/component.js.map +1 -1
  68. package/cssm/components/screens/hint/index.module.css +4 -6
  69. package/cssm/components/screens/initial/component.d.ts +1 -1
  70. package/cssm/components/screens/initial/component.js +2 -2
  71. package/cssm/components/screens/initial/component.js.map +1 -1
  72. package/cssm/components/screens/initial/countdown-section.d.ts +1 -1
  73. package/cssm/components/screens/initial/countdown-section.js.map +1 -1
  74. package/cssm/components/screens/initial/index.module.css +3 -5
  75. package/cssm/components/screens/temp-block/component.d.ts +1 -1
  76. package/cssm/components/screens/temp-block/component.js +2 -2
  77. package/cssm/components/screens/temp-block/component.js.map +1 -1
  78. package/cssm/components/screens/temp-block/index.module.css +2 -4
  79. package/cssm/components/screens/temp-block-over/component.d.ts +1 -1
  80. package/cssm/components/screens/temp-block-over/component.js +2 -2
  81. package/cssm/components/screens/temp-block-over/component.js.map +1 -1
  82. package/cssm/components/screens/temp-block-over/index.module.css +2 -4
  83. package/cssm/context.d.ts +1 -1
  84. package/cssm/context.js +1 -0
  85. package/cssm/context.js.map +1 -1
  86. package/cssm/desktop/component.desktop.d.ts +2 -2
  87. package/cssm/desktop/component.desktop.js.map +1 -1
  88. package/cssm/mobile/component.mobile.d.ts +2 -2
  89. package/cssm/mobile/component.mobile.js.map +1 -1
  90. package/cssm/types.d.ts +13 -8
  91. package/cssm/types.js.map +1 -1
  92. package/cssm/utils.d.ts +1 -1
  93. package/cssm/utils.js.map +1 -1
  94. package/desktop/component.desktop.d.ts +2 -2
  95. package/desktop/component.desktop.js.map +1 -1
  96. package/esm/component.responsive.d.ts +2 -2
  97. package/esm/component.responsive.js.map +1 -1
  98. package/esm/components/base-confirmation/component.d.ts +2 -2
  99. package/esm/components/base-confirmation/component.js +4 -3
  100. package/esm/components/base-confirmation/component.js.map +1 -1
  101. package/esm/components/base-confirmation/index.css +3 -3
  102. package/esm/components/base-confirmation/index.module.css.js +1 -1
  103. package/esm/components/base-confirmation/index.module.css.js.map +1 -1
  104. package/esm/components/countdown-loader/component.d.ts +1 -1
  105. package/esm/components/countdown-loader/component.js.map +1 -1
  106. package/esm/components/countdown-loader/index.css +1 -1
  107. package/esm/components/countdown-loader/index.module.css.js +1 -1
  108. package/esm/components/countdown-loader/index.module.css.js.map +1 -1
  109. package/esm/components/header/component.d.ts +6 -1
  110. package/esm/components/header/component.js +2 -2
  111. package/esm/components/header/component.js.map +1 -1
  112. package/esm/components/header/index.css +5 -5
  113. package/esm/components/header/index.module.css.js +1 -1
  114. package/esm/components/screens/fatal-error/component.d.ts +1 -1
  115. package/esm/components/screens/fatal-error/component.js +2 -2
  116. package/esm/components/screens/fatal-error/component.js.map +1 -1
  117. package/esm/components/screens/fatal-error/index.css +8 -10
  118. package/esm/components/screens/fatal-error/index.module.css.js +1 -1
  119. package/esm/components/screens/hint/component.d.ts +1 -1
  120. package/esm/components/screens/hint/component.js +2 -2
  121. package/esm/components/screens/hint/component.js.map +1 -1
  122. package/esm/components/screens/hint/index.css +16 -18
  123. package/esm/components/screens/hint/index.module.css.js +1 -1
  124. package/esm/components/screens/initial/component.d.ts +1 -1
  125. package/esm/components/screens/initial/component.js +2 -2
  126. package/esm/components/screens/initial/component.js.map +1 -1
  127. package/esm/components/screens/initial/countdown-section.d.ts +1 -1
  128. package/esm/components/screens/initial/countdown-section.js.map +1 -1
  129. package/esm/components/screens/initial/index.css +22 -24
  130. package/esm/components/screens/initial/index.module.css.js +1 -1
  131. package/esm/components/screens/temp-block/component.d.ts +1 -1
  132. package/esm/components/screens/temp-block/component.js +2 -2
  133. package/esm/components/screens/temp-block/component.js.map +1 -1
  134. package/esm/components/screens/temp-block/index.css +10 -12
  135. package/esm/components/screens/temp-block/index.module.css.js +1 -1
  136. package/esm/components/screens/temp-block-over/component.d.ts +1 -1
  137. package/esm/components/screens/temp-block-over/component.js +2 -2
  138. package/esm/components/screens/temp-block-over/component.js.map +1 -1
  139. package/esm/components/screens/temp-block-over/index.css +7 -9
  140. package/esm/components/screens/temp-block-over/index.module.css.js +1 -1
  141. package/esm/context.d.ts +1 -1
  142. package/esm/context.js +1 -0
  143. package/esm/context.js.map +1 -1
  144. package/esm/desktop/component.desktop.d.ts +2 -2
  145. package/esm/desktop/component.desktop.js.map +1 -1
  146. package/esm/mobile/component.mobile.d.ts +2 -2
  147. package/esm/mobile/component.mobile.js.map +1 -1
  148. package/esm/mobile/mobile.css +1 -1
  149. package/esm/mobile/mobile.module.css.js +1 -1
  150. package/esm/types.d.ts +13 -8
  151. package/esm/types.js.map +1 -1
  152. package/esm/utils.d.ts +1 -1
  153. package/esm/utils.js.map +1 -1
  154. package/mobile/component.mobile.d.ts +2 -2
  155. package/mobile/component.mobile.js.map +1 -1
  156. package/mobile/mobile.css +1 -1
  157. package/mobile/mobile.module.css.js +1 -1
  158. package/modern/component.responsive.d.ts +2 -2
  159. package/modern/component.responsive.js.map +1 -1
  160. package/modern/components/base-confirmation/component.d.ts +2 -2
  161. package/modern/components/base-confirmation/component.js +3 -2
  162. package/modern/components/base-confirmation/component.js.map +1 -1
  163. package/modern/components/base-confirmation/index.css +3 -3
  164. package/modern/components/base-confirmation/index.module.css.js +1 -1
  165. package/modern/components/base-confirmation/index.module.css.js.map +1 -1
  166. package/modern/components/countdown-loader/component.d.ts +1 -1
  167. package/modern/components/countdown-loader/component.js.map +1 -1
  168. package/modern/components/countdown-loader/index.css +1 -1
  169. package/modern/components/countdown-loader/index.module.css.js +1 -1
  170. package/modern/components/countdown-loader/index.module.css.js.map +1 -1
  171. package/modern/components/header/component.d.ts +6 -1
  172. package/modern/components/header/component.js +1 -1
  173. package/modern/components/header/component.js.map +1 -1
  174. package/modern/components/header/index.css +5 -5
  175. package/modern/components/header/index.module.css.js +1 -1
  176. package/modern/components/screens/fatal-error/component.d.ts +1 -1
  177. package/modern/components/screens/fatal-error/component.js +2 -2
  178. package/modern/components/screens/fatal-error/component.js.map +1 -1
  179. package/modern/components/screens/fatal-error/index.css +8 -10
  180. package/modern/components/screens/fatal-error/index.module.css.js +1 -1
  181. package/modern/components/screens/hint/component.d.ts +1 -1
  182. package/modern/components/screens/hint/component.js +2 -2
  183. package/modern/components/screens/hint/component.js.map +1 -1
  184. package/modern/components/screens/hint/index.css +16 -18
  185. package/modern/components/screens/hint/index.module.css.js +1 -1
  186. package/modern/components/screens/initial/component.d.ts +1 -1
  187. package/modern/components/screens/initial/component.js +2 -2
  188. package/modern/components/screens/initial/component.js.map +1 -1
  189. package/modern/components/screens/initial/countdown-section.d.ts +1 -1
  190. package/modern/components/screens/initial/countdown-section.js.map +1 -1
  191. package/modern/components/screens/initial/index.css +22 -24
  192. package/modern/components/screens/initial/index.module.css.js +1 -1
  193. package/modern/components/screens/temp-block/component.d.ts +1 -1
  194. package/modern/components/screens/temp-block/component.js +2 -2
  195. package/modern/components/screens/temp-block/component.js.map +1 -1
  196. package/modern/components/screens/temp-block/index.css +10 -12
  197. package/modern/components/screens/temp-block/index.module.css.js +1 -1
  198. package/modern/components/screens/temp-block-over/component.d.ts +1 -1
  199. package/modern/components/screens/temp-block-over/component.js +2 -2
  200. package/modern/components/screens/temp-block-over/component.js.map +1 -1
  201. package/modern/components/screens/temp-block-over/index.css +7 -9
  202. package/modern/components/screens/temp-block-over/index.module.css.js +1 -1
  203. package/modern/context.d.ts +1 -1
  204. package/modern/context.js +1 -0
  205. package/modern/context.js.map +1 -1
  206. package/modern/desktop/component.desktop.d.ts +2 -2
  207. package/modern/desktop/component.desktop.js.map +1 -1
  208. package/modern/mobile/component.mobile.d.ts +2 -2
  209. package/modern/mobile/component.mobile.js.map +1 -1
  210. package/modern/mobile/mobile.css +1 -1
  211. package/modern/mobile/mobile.module.css.js +1 -1
  212. package/modern/types.d.ts +13 -8
  213. package/modern/types.js.map +1 -1
  214. package/modern/utils.d.ts +1 -1
  215. package/modern/utils.js.map +1 -1
  216. package/moderncssm/component.responsive.d.ts +2 -2
  217. package/moderncssm/component.responsive.js.map +1 -1
  218. package/moderncssm/components/base-confirmation/component.d.ts +2 -2
  219. package/moderncssm/components/base-confirmation/component.js +3 -2
  220. package/moderncssm/components/base-confirmation/component.js.map +1 -1
  221. package/moderncssm/components/base-confirmation/index.module.css +3 -2
  222. package/moderncssm/components/countdown-loader/component.d.ts +1 -1
  223. package/moderncssm/components/countdown-loader/component.js.map +1 -1
  224. package/moderncssm/components/countdown-loader/index.module.css +2 -0
  225. package/moderncssm/components/header/component.d.ts +6 -1
  226. package/moderncssm/components/header/component.js +1 -1
  227. package/moderncssm/components/header/component.js.map +1 -1
  228. package/moderncssm/components/header/index.module.css +2 -0
  229. package/moderncssm/components/screens/fatal-error/component.d.ts +1 -1
  230. package/moderncssm/components/screens/fatal-error/component.js +2 -2
  231. package/moderncssm/components/screens/fatal-error/component.js.map +1 -1
  232. package/moderncssm/components/screens/fatal-error/index.module.css +2 -2
  233. package/moderncssm/components/screens/hint/component.d.ts +1 -1
  234. package/moderncssm/components/screens/hint/component.js +2 -2
  235. package/moderncssm/components/screens/hint/component.js.map +1 -1
  236. package/moderncssm/components/screens/hint/index.module.css +4 -4
  237. package/moderncssm/components/screens/initial/component.d.ts +1 -1
  238. package/moderncssm/components/screens/initial/component.js +2 -2
  239. package/moderncssm/components/screens/initial/component.js.map +1 -1
  240. package/moderncssm/components/screens/initial/countdown-section.d.ts +1 -1
  241. package/moderncssm/components/screens/initial/countdown-section.js.map +1 -1
  242. package/moderncssm/components/screens/initial/index.module.css +3 -3
  243. package/moderncssm/components/screens/temp-block/component.d.ts +1 -1
  244. package/moderncssm/components/screens/temp-block/component.js +2 -2
  245. package/moderncssm/components/screens/temp-block/component.js.map +1 -1
  246. package/moderncssm/components/screens/temp-block/index.module.css +2 -2
  247. package/moderncssm/components/screens/temp-block-over/component.d.ts +1 -1
  248. package/moderncssm/components/screens/temp-block-over/component.js +2 -2
  249. package/moderncssm/components/screens/temp-block-over/component.js.map +1 -1
  250. package/moderncssm/components/screens/temp-block-over/index.module.css +2 -2
  251. package/moderncssm/context.d.ts +1 -1
  252. package/moderncssm/context.js +1 -0
  253. package/moderncssm/context.js.map +1 -1
  254. package/moderncssm/desktop/component.desktop.d.ts +2 -2
  255. package/moderncssm/desktop/component.desktop.js.map +1 -1
  256. package/moderncssm/mobile/component.mobile.d.ts +2 -2
  257. package/moderncssm/mobile/component.mobile.js.map +1 -1
  258. package/moderncssm/types.d.ts +13 -8
  259. package/moderncssm/types.js.map +1 -1
  260. package/moderncssm/utils.d.ts +1 -1
  261. package/moderncssm/utils.js.map +1 -1
  262. package/package.json +3 -3
  263. package/src/component.responsive.tsx +2 -2
  264. package/src/components/base-confirmation/component.tsx +5 -6
  265. package/src/components/base-confirmation/index.module.css +1 -1
  266. package/src/components/countdown-loader/component.tsx +1 -1
  267. package/src/components/countdown-loader/index.module.css +1 -1
  268. package/src/components/header/component.tsx +9 -3
  269. package/src/components/screens/fatal-error/component.tsx +5 -3
  270. package/src/components/screens/hint/component.tsx +5 -3
  271. package/src/components/screens/initial/component.tsx +9 -3
  272. package/src/components/screens/initial/countdown-section.tsx +1 -1
  273. package/src/components/screens/temp-block/component.tsx +12 -4
  274. package/src/components/screens/temp-block-over/component.tsx +5 -3
  275. package/src/context.ts +2 -1
  276. package/src/desktop/component.desktop.tsx +2 -2
  277. package/src/mobile/component.mobile.tsx +2 -2
  278. package/src/types.ts +14 -7
  279. package/src/utils.ts +1 -1
  280. package/src/vars.css +1 -1
  281. package/types.d.ts +13 -8
  282. package/types.js.map +1 -1
  283. package/utils.d.ts +1 -1
  284. package/utils.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/components/screens/initial/component.tsx"],"sourcesContent":["import React, { FC, useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport cn from 'classnames';\n\nimport { ButtonMobile } from '@alfalab/core-components-button/mobile';\nimport { CodeInputDesktop } from '@alfalab/core-components-code-input/desktop';\nimport { CodeInputMobile } from '@alfalab/core-components-code-input/mobile';\nimport { BaseCodeInputProps, CustomInputRef } from '@alfalab/core-components-code-input/shared';\nimport { Link } from '@alfalab/core-components-link';\nimport { Text } from '@alfalab/core-components-typography';\nimport { useLayoutEffect_SAFE_FOR_SSR, usePrevious } from '@alfalab/hooks';\n\nimport { ConfirmationContext } from '../../../context';\nimport { Header } from '../../header';\n\nimport { CountdownSection } from './countdown-section';\n\nimport styles from './index.module.css';\n\nexport type InitialProps = {\n /**\n * Отображать в мобильной версии экран компонента\n */\n mobile?: boolean;\n};\n\nconst CODE_SEND_HINT_VISIBLE_DURATION = 2000;\n\nexport const Initial: FC<InitialProps> = ({ mobile }) => {\n const {\n state,\n alignContent,\n texts,\n requiredCharAmount,\n timeLeft,\n phone,\n clearCodeOnError,\n hideCountdownSection,\n initialScreenHintSlot,\n errorVisibleDuration,\n onChangeState,\n onInputFinished,\n onChangeScreen,\n onSmsRetryClick,\n } = useContext(ConfirmationContext);\n\n const prevState = usePrevious(state);\n\n const inputRef = useRef<CustomInputRef>(null);\n\n const [codeSendHintVisible, setCodeSendHintVisible] = useState(false);\n\n const timerId = useRef(0);\n\n const handleInputComplete: BaseCodeInputProps['onComplete'] = (code) => {\n onInputFinished(code);\n };\n\n const handleSmsHintLinkClick = () => {\n onChangeScreen('HINT');\n };\n\n const handleInputChange = () => {\n if (state === 'CODE_ERROR') {\n onChangeState('INITIAL');\n }\n };\n\n const handleSmsRetryClick = () => {\n if (inputRef.current) {\n inputRef.current.reset();\n }\n\n onSmsRetryClick();\n };\n\n const handleErrorAnimationEnd = () => {\n if (clearCodeOnError && state !== 'INITIAL') {\n onChangeState('INITIAL');\n }\n };\n\n const clearTimer = useCallback(() => {\n window.clearTimeout(timerId.current);\n }, []);\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n\n return () => {\n clearTimer();\n };\n }, [clearTimer]);\n\n useEffect(() => {\n if (!inputRef.current) {\n return;\n }\n\n if (prevState === 'CODE_SENDING' && state !== 'CODE_SENDING') {\n inputRef.current.focus();\n }\n }, [prevState, state, requiredCharAmount]);\n\n useLayoutEffect_SAFE_FOR_SSR(() => {\n if (prevState === 'CODE_SENDING' && state !== 'CODE_SENDING') {\n setCodeSendHintVisible(true);\n\n clearTimer();\n\n timerId.current = window.setTimeout(() => {\n setCodeSendHintVisible(false);\n }, CODE_SEND_HINT_VISIBLE_DURATION);\n }\n }, [prevState, state, clearTimer]);\n\n const getCodeInputError = (): string | boolean => {\n if (state === 'CODE_EXPIRED') {\n return texts.codeErrorExpired || true;\n }\n\n if (state === 'CODE_EXPIRED_ENDED') {\n return texts.codeErrorExpiredEnded || true;\n }\n\n if (state === 'CODE_ERROR') {\n return texts.codeError || true;\n }\n\n return false;\n };\n\n const renderHintButton = () => {\n if (initialScreenHintSlot) {\n return initialScreenHintSlot;\n }\n\n if (mobile) {\n return (\n <ButtonMobile\n onClick={handleSmsHintLinkClick}\n className={styles.smsBtn}\n view='text'\n size='xs'\n >\n {texts.linkToHint}\n </ButtonMobile>\n );\n }\n\n return (\n <Link\n onClick={handleSmsHintLinkClick}\n className={styles.smsComeLink}\n view={mobile ? 'primary' : 'secondary'}\n pseudo={true}\n >\n {texts.linkToHint}\n </Link>\n );\n };\n\n const processing = ['CODE_CHECKING', 'CODE_SENDING'].includes(state);\n\n const timePassed = timeLeft === 0;\n\n const ComponentCodeInput = mobile ? CodeInputMobile : CodeInputDesktop;\n\n return (\n <div className={cn(styles.component, styles[alignContent])}>\n <Header mobile={mobile}>{texts.title}</Header>\n\n {phone ? (\n <Text\n view='primary-medium'\n color='primary'\n className={cn(styles.phone, {\n [styles.typographyTheme]: !mobile,\n [styles.typographyThemeMobile]: mobile,\n })}\n >\n Отправили на {phone}\n </Text>\n ) : null}\n <ComponentCodeInput\n disabled={processing}\n error={getCodeInputError()}\n ref={inputRef}\n fields={requiredCharAmount}\n className={cn(styles.containerInput, styles.codeInput)}\n onComplete={handleInputComplete}\n onChange={handleInputChange}\n clearCodeOnError={clearCodeOnError}\n errorVisibleDuration={errorVisibleDuration}\n onErrorAnimationEnd={handleErrorAnimationEnd}\n />\n {!hideCountdownSection && (\n <CountdownSection\n processing={processing}\n timePassed={timePassed}\n codeSendHintVisible={codeSendHintVisible}\n handleSmsRetryClick={handleSmsRetryClick}\n mobile={mobile}\n />\n )}\n\n {renderHintButton()}\n </div>\n );\n};\n"],"names":["mobile","useContext","ConfirmationContext","usePrevious","useRef","useState","useCallback","useEffect","useLayoutEffect_SAFE_FOR_SSR","React","ButtonMobile","styles","Link","CodeInputMobile","CodeInputDesktop","cn","Header","Text","CountdownSection"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAM,+BAA+B,GAAG,IAAI;AAErC,IAAM,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M,CAAC,SAAS,EAAEA,YAAM,CAAC,YAAY,CAAC,CAAC,EAAA;QACtDF,sBAAC,CAAA,aAAA,CAAAO,gBAAM,IAAC,MAAM,EAAEhB,QAAM,EAAG,EAAA,KAAK,CAAC,KAAK,CAAU;QAE7C,KAAK,IACFS,qCAACQ,6BAAI,EAAA,EACD,IAAI,EAAC,gBAAgB,EACrB,KAAK,EAAC,SAAS,EACf,SAAS,EAAEF,mBAAE,CAACJ,YAAM,CAAC,KAAK,GAAA,EAAA,GAAA,EAAA;AACtB,gBAAA,EAAA,CAACA,YAAM,CAAC,eAAe,CAAA,GAAG,CAACX,QAAM;AACjC,gBAAA,EAAA,CAACW,YAAM,CAAC,qBAAqB,CAAA,GAAGX,QAAM;AACxC,gBAAA,EAAA,EAAA,EAAA;;AAEY,YAAA,KAAK,CAChB,IACP,IAAI;QACRS,sBAAC,CAAA,aAAA,CAAA,kBAAkB,IACf,QAAQ,EAAE,UAAU,EACpB,KAAK,EAAE,iBAAiB,EAAE,EAC1B,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,kBAAkB,EAC1B,SAAS,EAAEM,mBAAE,CAACJ,YAAM,CAAC,cAAc,EAAEA,YAAM,CAAC,SAAS,CAAC,EACtD,UAAU,EAAE,mBAAmB,EAC/B,QAAQ,EAAE,iBAAiB,EAC3B,gBAAgB,EAAE,gBAAgB,EAClC,oBAAoB,EAAE,oBAAoB,EAC1C,mBAAmB,EAAE,uBAAuB,EAC9C,CAAA;QACD,CAAC,oBAAoB,KAClBF,sBAAC,CAAA,aAAA,CAAAS,iCAAgB,EACb,EAAA,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,mBAAmB,EAAE,mBAAmB,EACxC,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAElB,QAAM,EAAA,CAChB,CACL;QAEA,gBAAgB,EAAE,CACjB;AAEd;;;;"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/components/screens/initial/component.tsx"],"sourcesContent":["import React, { type FC, useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport cn from 'classnames';\n\nimport { ButtonMobile } from '@alfalab/core-components-button/mobile';\nimport { CodeInputDesktop } from '@alfalab/core-components-code-input/desktop';\nimport { CodeInputMobile } from '@alfalab/core-components-code-input/mobile';\nimport {\n type BaseCodeInputProps,\n type CustomInputRef,\n} from '@alfalab/core-components-code-input/shared';\nimport { Link } from '@alfalab/core-components-link';\nimport { Text } from '@alfalab/core-components-typography';\nimport { useLayoutEffect_SAFE_FOR_SSR, usePrevious } from '@alfalab/hooks';\n\nimport { ConfirmationContext } from '../../../context';\nimport { Header } from '../../header';\n\nimport { CountdownSection } from './countdown-section';\n\nimport styles from './index.module.css';\n\nexport type InitialProps = {\n /**\n * Отображать в мобильной версии экран компонента\n */\n mobile?: boolean;\n};\n\nconst CODE_SEND_HINT_VISIBLE_DURATION = 2000;\n\nexport const Initial: FC<InitialProps> = ({ mobile }) => {\n const {\n state,\n alignContent,\n titleTag,\n texts,\n requiredCharAmount,\n timeLeft,\n phone,\n clearCodeOnError,\n hideCountdownSection,\n initialScreenHintSlot,\n errorVisibleDuration,\n onChangeState,\n onInputFinished,\n onChangeScreen,\n onSmsRetryClick,\n } = useContext(ConfirmationContext);\n\n const prevState = usePrevious(state);\n\n const inputRef = useRef<CustomInputRef>(null);\n\n const [codeSendHintVisible, setCodeSendHintVisible] = useState(false);\n\n const timerId = useRef(0);\n\n const handleInputComplete: BaseCodeInputProps['onComplete'] = (code) => {\n onInputFinished(code);\n };\n\n const handleSmsHintLinkClick = () => {\n onChangeScreen('HINT');\n };\n\n const handleInputChange = () => {\n if (state === 'CODE_ERROR') {\n onChangeState('INITIAL');\n }\n };\n\n const handleSmsRetryClick = () => {\n if (inputRef.current) {\n inputRef.current.reset();\n }\n\n onSmsRetryClick();\n };\n\n const handleErrorAnimationEnd = () => {\n if (clearCodeOnError && state !== 'INITIAL') {\n onChangeState('INITIAL');\n }\n };\n\n const clearTimer = useCallback(() => {\n window.clearTimeout(timerId.current);\n }, []);\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n\n return () => {\n clearTimer();\n };\n }, [clearTimer]);\n\n useEffect(() => {\n if (!inputRef.current) {\n return;\n }\n\n if (prevState === 'CODE_SENDING' && state !== 'CODE_SENDING') {\n inputRef.current.focus();\n }\n }, [prevState, state, requiredCharAmount]);\n\n useLayoutEffect_SAFE_FOR_SSR(() => {\n if (prevState === 'CODE_SENDING' && state !== 'CODE_SENDING') {\n setCodeSendHintVisible(true);\n\n clearTimer();\n\n timerId.current = window.setTimeout(() => {\n setCodeSendHintVisible(false);\n }, CODE_SEND_HINT_VISIBLE_DURATION);\n }\n }, [prevState, state, clearTimer]);\n\n const getCodeInputError = (): string | boolean => {\n if (state === 'CODE_EXPIRED') {\n return texts.codeErrorExpired || true;\n }\n\n if (state === 'CODE_EXPIRED_ENDED') {\n return texts.codeErrorExpiredEnded || true;\n }\n\n if (state === 'CODE_ERROR') {\n return texts.codeError || true;\n }\n\n return false;\n };\n\n const renderHintButton = () => {\n if (initialScreenHintSlot) {\n return initialScreenHintSlot;\n }\n\n if (mobile) {\n return (\n <ButtonMobile\n onClick={handleSmsHintLinkClick}\n className={styles.smsBtn}\n view='text'\n size='xs'\n >\n {texts.linkToHint}\n </ButtonMobile>\n );\n }\n\n return (\n <Link\n onClick={handleSmsHintLinkClick}\n className={styles.smsComeLink}\n view={mobile ? 'primary' : 'secondary'}\n pseudo={true}\n >\n {texts.linkToHint}\n </Link>\n );\n };\n\n const processing = ['CODE_CHECKING', 'CODE_SENDING'].includes(state);\n\n const timePassed = timeLeft === 0;\n\n const ComponentCodeInput = mobile ? CodeInputMobile : CodeInputDesktop;\n\n return (\n <div className={cn(styles.component, styles[alignContent])}>\n <Header mobile={mobile} titleTag={titleTag}>\n {texts.title}\n </Header>\n\n {phone ? (\n <Text\n view='primary-medium'\n color='primary'\n className={cn(styles.phone, {\n [styles.typographyTheme]: !mobile,\n [styles.typographyThemeMobile]: mobile,\n })}\n >\n Отправили на {phone}\n </Text>\n ) : null}\n <ComponentCodeInput\n disabled={processing}\n error={getCodeInputError()}\n ref={inputRef}\n fields={requiredCharAmount}\n className={cn(styles.containerInput, styles.codeInput)}\n onComplete={handleInputComplete}\n onChange={handleInputChange}\n clearCodeOnError={clearCodeOnError}\n errorVisibleDuration={errorVisibleDuration}\n onErrorAnimationEnd={handleErrorAnimationEnd}\n />\n {!hideCountdownSection && (\n <CountdownSection\n processing={processing}\n timePassed={timePassed}\n codeSendHintVisible={codeSendHintVisible}\n handleSmsRetryClick={handleSmsRetryClick}\n mobile={mobile}\n />\n )}\n\n {renderHintButton()}\n </div>\n );\n};\n"],"names":["mobile","useContext","ConfirmationContext","usePrevious","useRef","useState","useCallback","useEffect","useLayoutEffect_SAFE_FOR_SSR","React","ButtonMobile","styles","Link","CodeInputMobile","CodeInputDesktop","cn","Header","Text","CountdownSection"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4BA,IAAM,+BAA+B,GAAG,IAAI;AAErC,IAAM,OAAO,GAAqB,UAAC,EAAU,EAAA;;AAAR,IAAA,IAAAA,QAAM,GAAA,EAAA,CAAA,MAAA;IACxC,IAAA,EAAA,GAgBFC,gBAAU,CAACC,2BAAmB,CAAC,EAf/B,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,kBAAkB,GAAA,EAAA,CAAA,kBAAA,EAClB,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,KAAK,WAAA,EACL,gBAAgB,sBAAA,EAChB,oBAAoB,0BAAA,EACpB,qBAAqB,GAAA,EAAA,CAAA,qBAAA,EACrB,oBAAoB,GAAA,EAAA,CAAA,oBAAA,EACpB,aAAa,GAAA,EAAA,CAAA,aAAA,EACb,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,cAAc,GAAA,EAAA,CA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KAAK,CAChB,IACP,IAAI;QACRS,sBAAC,CAAA,aAAA,CAAA,kBAAkB,IACf,QAAQ,EAAE,UAAU,EACpB,KAAK,EAAE,iBAAiB,EAAE,EAC1B,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,kBAAkB,EAC1B,SAAS,EAAEM,mBAAE,CAACJ,YAAM,CAAC,cAAc,EAAEA,YAAM,CAAC,SAAS,CAAC,EACtD,UAAU,EAAE,mBAAmB,EAC/B,QAAQ,EAAE,iBAAiB,EAC3B,gBAAgB,EAAE,gBAAgB,EAClC,oBAAoB,EAAE,oBAAoB,EAC1C,mBAAmB,EAAE,uBAAuB,EAC9C,CAAA;QACD,CAAC,oBAAoB,KAClBF,sBAAC,CAAA,aAAA,CAAAS,iCAAgB,EACb,EAAA,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,mBAAmB,EAAE,mBAAmB,EACxC,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAElB,QAAM,EAAA,CAChB,CACL;QAEA,gBAAgB,EAAE,CACjB;AAEd;;;;"}
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import { type FC } from 'react';
2
2
  declare type CountdownSectionProps = {
3
3
  codeSendHintVisible: boolean;
4
4
  timePassed: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"countdown-section.js","sources":["../../../src/components/screens/initial/countdown-section.tsx"],"sourcesContent":["import React, { FC, Fragment, ReactNode, useContext } from 'react';\nimport cn from 'classnames';\n\nimport { Button } from '@alfalab/core-components-button';\nimport { Spinner } from '@alfalab/core-components-spinner';\nimport { Text } from '@alfalab/core-components-typography';\n\nimport { ConfirmationContext } from '../../../context';\nimport { formatMsAsMinutes } from '../../../utils';\n\nimport styles from './index.module.css';\n\ntype CountdownSectionProps = {\n codeSendHintVisible: boolean;\n timePassed: boolean;\n processing: boolean;\n mobile?: boolean;\n handleSmsRetryClick: () => void;\n};\n\nexport const CountdownSection: FC<CountdownSectionProps> = ({\n codeSendHintVisible,\n timePassed,\n processing,\n mobile,\n handleSmsRetryClick,\n}) => {\n const { state, texts, timeLeft, blockSmsRetry, breakpoint, client } =\n useContext(ConfirmationContext);\n\n const renderText = (content: ReactNode) => (\n <Text\n className={cn(styles.countdownContainer, {\n [styles.countdownMobile]: mobile,\n [styles.typographyTheme]: !mobile,\n })}\n view={mobile ? 'primary-small' : 'primary-medium'}\n tag='div'\n >\n {content}\n </Text>\n );\n\n if (codeSendHintVisible) return renderText(texts.codeSended);\n\n if (processing) {\n return (\n <div\n className={cn(styles.loaderWrap, styles.countdownContainer, {\n [styles.countdownLoaderMobile]: mobile,\n [styles.typographyTheme]: !mobile,\n })}\n >\n <Spinner preset={24} visible={true} />\n\n <span className={styles.loaderText}>\n {state === 'CODE_CHECKING' ? texts.codeChecking : texts.codeSending}\n </span>\n </div>\n );\n }\n\n if (blockSmsRetry) return renderText(texts.noAttemptsLeft);\n\n if (timePassed) {\n return (\n <Button\n size={mobile ? 'xs' : 'xxs'}\n view='secondary'\n onClick={handleSmsRetryClick}\n className={cn(styles.getCodeButton, { [styles.getCodeButtonMobile]: mobile })}\n breakpoint={breakpoint}\n client={client}\n >\n {texts.buttonRetry}\n </Button>\n );\n }\n\n return renderText(\n <Fragment>\n {texts.countdown}\n {'\\u00A0'}\n <time className={styles.timeCounter}>{formatMsAsMinutes(timeLeft)}</time>\n </Fragment>,\n );\n};\n"],"names":["useContext","ConfirmationContext","React","Text","cn","styles","Spinner","Button","Fragment","formatMsAsMinutes"],"mappings":";;;;;;;;;;;;;;;;;;AAoBO,IAAM,gBAAgB,GAA8B,UAAC,EAM3D,EAAA;;AALG,IAAA,IAAA,mBAAmB,GAAA,EAAA,CAAA,mBAAA,EACnB,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,mBAAmB,GAAA,EAAA,CAAA,mBAAA;IAEb,IAAA,EAAA,GACFA,gBAAU,CAAC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A,CAAA,MAAA,EAAA,EAAA,SAAS,EAAEG,YAAM,CAAC,UAAU,IAC7B,KAAK,KAAK,eAAe,GAAG,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,WAAW,CAChE,CACL;AAEb;AAED,IAAA,IAAI,aAAa;AAAE,QAAA,OAAO,UAAU,CAAC,KAAK,CAAC,cAAc,CAAC;AAE1D,IAAA,IAAI,UAAU,EAAE;QACZ,QACIH,sBAAC,CAAA,aAAA,CAAAK,2BAAM,EACH,EAAA,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,EAC3B,IAAI,EAAC,WAAW,EAChB,OAAO,EAAE,mBAAmB,EAC5B,SAAS,EAAEH,mBAAE,CAACC,YAAM,CAAC,aAAa,GAAI,EAAA,GAAA,EAAA,EAAA,EAAA,CAACA,YAAM,CAAC,mBAAmB,CAAG,GAAA,MAAM,EAAG,EAAA,EAAA,EAC7E,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EAEb,EAAA,KAAK,CAAC,WAAW,CACb;AAEhB;IAED,OAAO,UAAU,CACbH,sBAAA,CAAA,aAAA,CAACM,cAAQ,EAAA,IAAA;AACJ,QAAA,KAAK,CAAC,SAAS;QACf,QAAQ;AACT,QAAAN,sBAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAEG,YAAM,CAAC,WAAW,EAAA,EAAGI,uBAAiB,CAAC,QAAQ,CAAC,CAAQ,CAClE,CACd;AACL;;;;"}
1
+ {"version":3,"file":"countdown-section.js","sources":["../../../src/components/screens/initial/countdown-section.tsx"],"sourcesContent":["import React, { type FC, Fragment, type ReactNode, useContext } from 'react';\nimport cn from 'classnames';\n\nimport { Button } from '@alfalab/core-components-button';\nimport { Spinner } from '@alfalab/core-components-spinner';\nimport { Text } from '@alfalab/core-components-typography';\n\nimport { ConfirmationContext } from '../../../context';\nimport { formatMsAsMinutes } from '../../../utils';\n\nimport styles from './index.module.css';\n\ntype CountdownSectionProps = {\n codeSendHintVisible: boolean;\n timePassed: boolean;\n processing: boolean;\n mobile?: boolean;\n handleSmsRetryClick: () => void;\n};\n\nexport const CountdownSection: FC<CountdownSectionProps> = ({\n codeSendHintVisible,\n timePassed,\n processing,\n mobile,\n handleSmsRetryClick,\n}) => {\n const { state, texts, timeLeft, blockSmsRetry, breakpoint, client } =\n useContext(ConfirmationContext);\n\n const renderText = (content: ReactNode) => (\n <Text\n className={cn(styles.countdownContainer, {\n [styles.countdownMobile]: mobile,\n [styles.typographyTheme]: !mobile,\n })}\n view={mobile ? 'primary-small' : 'primary-medium'}\n tag='div'\n >\n {content}\n </Text>\n );\n\n if (codeSendHintVisible) return renderText(texts.codeSended);\n\n if (processing) {\n return (\n <div\n className={cn(styles.loaderWrap, styles.countdownContainer, {\n [styles.countdownLoaderMobile]: mobile,\n [styles.typographyTheme]: !mobile,\n })}\n >\n <Spinner preset={24} visible={true} />\n\n <span className={styles.loaderText}>\n {state === 'CODE_CHECKING' ? texts.codeChecking : texts.codeSending}\n </span>\n </div>\n );\n }\n\n if (blockSmsRetry) return renderText(texts.noAttemptsLeft);\n\n if (timePassed) {\n return (\n <Button\n size={mobile ? 'xs' : 'xxs'}\n view='secondary'\n onClick={handleSmsRetryClick}\n className={cn(styles.getCodeButton, { [styles.getCodeButtonMobile]: mobile })}\n breakpoint={breakpoint}\n client={client}\n >\n {texts.buttonRetry}\n </Button>\n );\n }\n\n return renderText(\n <Fragment>\n {texts.countdown}\n {'\\u00A0'}\n <time className={styles.timeCounter}>{formatMsAsMinutes(timeLeft)}</time>\n </Fragment>,\n );\n};\n"],"names":["useContext","ConfirmationContext","React","Text","cn","styles","Spinner","Button","Fragment","formatMsAsMinutes"],"mappings":";;;;;;;;;;;;;;;;;;AAoBO,IAAM,gBAAgB,GAA8B,UAAC,EAM3D,EAAA;;AALG,IAAA,IAAA,mBAAmB,GAAA,EAAA,CAAA,mBAAA,EACnB,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,UAAU,GAAA,EAAA,CAA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AC,CAAA,aAAA,CAAAI,6BAAO,IAAC,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAI,CAAA;YAEtCJ,sBAAM,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,SAAS,EAAEG,YAAM,CAAC,UAAU,IAC7B,KAAK,KAAK,eAAe,GAAG,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,WAAW,CAChE,CACL;AAEb;AAED,IAAA,IAAI,aAAa;AAAE,QAAA,OAAO,UAAU,CAAC,KAAK,CAAC,cAAc,CAAC;AAE1D,IAAA,IAAI,UAAU,EAAE;QACZ,QACIH,sBAAC,CAAA,aAAA,CAAAK,2BAAM,EACH,EAAA,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,KAAK,EAC3B,IAAI,EAAC,WAAW,EAChB,OAAO,EAAE,mBAAmB,EAC5B,SAAS,EAAEH,mBAAE,CAACC,YAAM,CAAC,aAAa,GAAI,EAAA,GAAA,EAAA,EAAA,EAAA,CAACA,YAAM,CAAC,mBAAmB,CAAG,GAAA,MAAM,EAAG,EAAA,EAAA,EAC7E,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,EAEb,EAAA,KAAK,CAAC,WAAW,CACb;AAEhB;IAED,OAAO,UAAU,CACbH,sBAAA,CAAA,aAAA,CAACM,cAAQ,EAAA,IAAA;AACJ,QAAA,KAAK,CAAC,SAAS;QACf,QAAQ;AACT,QAAAN,sBAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAEG,YAAM,CAAC,WAAW,EAAA,EAAGI,uBAAiB,CAAC,QAAQ,CAAC,CAAQ,CAClE,CACd;AACL;;;;"}
@@ -16,8 +16,8 @@
16
16
  --gap-32: var(--gap-2xl);
17
17
  --gap-4-neg: var(--gap-2xs-neg);
18
18
  } :root {
19
- --font-family-system: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica,
20
- sans-serif;
19
+ --font-family-system:
20
+ system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, sans-serif;
21
21
  } :root {
22
22
  --size-xs-height: 40px;
23
23
  } :root {
@@ -26,62 +26,60 @@
26
26
  --confirmation-text-font-weight: 400;
27
27
  --confirmation-text-font-family: var(--font-family-system);
28
28
  --confirmation-text-color: var(--color-light-text-primary)
29
-
30
- /* header */
31
- } .confirmation__component_1nb2w {
29
+ } .confirmation__component_1s4y8 {
32
30
  display: flex;
33
31
  flex-direction: column;
34
- } .confirmation__phone_1nb2w.confirmation__phone_1nb2w {
32
+ } .confirmation__phone_1s4y8.confirmation__phone_1s4y8 {
35
33
  color: var(--color-light-text-primary);
36
34
  margin-bottom: var(--gap-32);
37
- } .confirmation__typographyTheme_1nb2w.confirmation__typographyTheme_1nb2w {
35
+ } .confirmation__typographyTheme_1s4y8.confirmation__typographyTheme_1s4y8 {
38
36
  font-size: var(--confirmation-text-font-size);
39
37
  line-height: var(--confirmation-text-line-height);
40
38
  font-weight: var(--confirmation-text-font-weight);
41
39
  font-family: var(--confirmation-text-font-family);
42
40
  color: var(--confirmation-text-color);
43
- } .confirmation__typographyThemeMobile_1nb2w.confirmation__typographyThemeMobile_1nb2w {
41
+ } .confirmation__typographyThemeMobile_1s4y8.confirmation__typographyThemeMobile_1s4y8 {
44
42
  color: var(--color-light-text-secondary);
45
- } .confirmation__compact_1nb2w {
43
+ } .confirmation__compact_1s4y8 {
46
44
  margin-bottom: var(--gap-24);
47
- } .confirmation__loaderWrap_1nb2w {
45
+ } .confirmation__loaderWrap_1s4y8 {
48
46
  display: flex;
49
47
  align-items: center;
50
- } .confirmation__left_1nb2w {
48
+ } .confirmation__left_1s4y8 {
51
49
  align-items: flex-start;
52
- } .confirmation__center_1nb2w {
50
+ } .confirmation__center_1s4y8 {
53
51
  align-items: center;
54
- text-align: center
55
- } .confirmation__center_1nb2w .confirmation__loaderWrap_1nb2w {
52
+ text-align: center;
53
+ } .confirmation__center_1s4y8 .confirmation__loaderWrap_1s4y8 {
56
54
  justify-content: center;
57
- } .confirmation__codeInput_1nb2w {
55
+ } .confirmation__codeInput_1s4y8 {
58
56
  margin-bottom: var(--gap-12);
59
- } .confirmation__smsBtn_1nb2w.confirmation__smsBtn_1nb2w {
57
+ } .confirmation__smsBtn_1s4y8.confirmation__smsBtn_1s4y8 {
60
58
  min-height: var(--size-xs-height);
61
- } .confirmation__smsComeLink_1nb2w.confirmation__smsComeLink_1nb2w {
59
+ } .confirmation__smsComeLink_1s4y8.confirmation__smsComeLink_1s4y8 {
62
60
  font-size: 14px;
63
61
  line-height: 20px;
64
62
  font-weight: 500;
65
- } .confirmation__countdownContainer_1nb2w.confirmation__countdownContainer_1nb2w {
63
+ } .confirmation__countdownContainer_1s4y8.confirmation__countdownContainer_1s4y8 {
66
64
  color: var(--color-light-text-secondary);
67
65
  margin-bottom: var(--gap-24);
68
- } .confirmation__countdownMobile_1nb2w.confirmation__countdownMobile_1nb2w {
66
+ } .confirmation__countdownMobile_1s4y8.confirmation__countdownMobile_1s4y8 {
69
67
  margin-bottom: var(--gap-20);
70
- } .confirmation__countdownLoaderMobile_1nb2w.confirmation__countdownLoaderMobile_1nb2w {
68
+ } .confirmation__countdownLoaderMobile_1s4y8.confirmation__countdownLoaderMobile_1s4y8 {
71
69
  margin-bottom: var(--gap-16);
72
- } .confirmation__timeCounter_1nb2w {
70
+ } .confirmation__timeCounter_1s4y8 {
73
71
  display: inline-block;
74
72
  min-width: 47px;
75
73
  color: var(--color-light-text-secondary);
76
74
  text-align: left;
77
75
  font-feature-settings: lining-nums tabular-nums;
78
76
  font-variant-numeric: lining-nums tabular-nums;
79
- } .confirmation__getCodeButton_1nb2w {
77
+ } .confirmation__getCodeButton_1s4y8 {
80
78
  position: relative;
81
79
  top: var(--gap-4-neg);
82
80
  margin-bottom: var(--gap-16);
83
- } .confirmation__getCodeButtonMobile_1nb2w {
81
+ } .confirmation__getCodeButtonMobile_1s4y8 {
84
82
  margin-bottom: var(--gap-0);
85
- } .confirmation__containerInput_1nb2w {
83
+ } .confirmation__containerInput_1s4y8 {
86
84
  min-height: 80px;
87
85
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./index.css');
4
4
 
5
- var styles = {"component":"confirmation__component_1nb2w","phone":"confirmation__phone_1nb2w","typographyTheme":"confirmation__typographyTheme_1nb2w","typographyThemeMobile":"confirmation__typographyThemeMobile_1nb2w","compact":"confirmation__compact_1nb2w","loaderWrap":"confirmation__loaderWrap_1nb2w","left":"confirmation__left_1nb2w","center":"confirmation__center_1nb2w","codeInput":"confirmation__codeInput_1nb2w","smsBtn":"confirmation__smsBtn_1nb2w","smsComeLink":"confirmation__smsComeLink_1nb2w","countdownContainer":"confirmation__countdownContainer_1nb2w","countdownMobile":"confirmation__countdownMobile_1nb2w","countdownLoaderMobile":"confirmation__countdownLoaderMobile_1nb2w","timeCounter":"confirmation__timeCounter_1nb2w","getCodeButton":"confirmation__getCodeButton_1nb2w","getCodeButtonMobile":"confirmation__getCodeButtonMobile_1nb2w","containerInput":"confirmation__containerInput_1nb2w"};
5
+ var styles = {"component":"confirmation__component_1s4y8","phone":"confirmation__phone_1s4y8","typographyTheme":"confirmation__typographyTheme_1s4y8","typographyThemeMobile":"confirmation__typographyThemeMobile_1s4y8","compact":"confirmation__compact_1s4y8","loaderWrap":"confirmation__loaderWrap_1s4y8","left":"confirmation__left_1s4y8","center":"confirmation__center_1s4y8","codeInput":"confirmation__codeInput_1s4y8","smsBtn":"confirmation__smsBtn_1s4y8","smsComeLink":"confirmation__smsComeLink_1s4y8","countdownContainer":"confirmation__countdownContainer_1s4y8","countdownMobile":"confirmation__countdownMobile_1s4y8","countdownLoaderMobile":"confirmation__countdownLoaderMobile_1s4y8","timeCounter":"confirmation__timeCounter_1s4y8","getCodeButton":"confirmation__getCodeButton_1s4y8","getCodeButtonMobile":"confirmation__getCodeButtonMobile_1s4y8","containerInput":"confirmation__containerInput_1s4y8"};
6
6
 
7
7
  module.exports = styles;
8
8
  //# sourceMappingURL=index.module.css.js.map
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import { type FC } from 'react';
2
2
  export declare type TempBlockProps = {
3
3
  /**
4
4
  * Отображать в мобильной версии экран компонента
@@ -19,7 +19,7 @@ var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
19
19
  var TempBlock = function (_a) {
20
20
  var _b, _c;
21
21
  var mobile = _a.mobile;
22
- var _d = React.useContext(context.ConfirmationContext), alignContent = _d.alignContent, texts = _d.texts, tempBlockDuration = _d.tempBlockDuration, onChangeScreen = _d.onChangeScreen, onTempBlockFinished = _d.onTempBlockFinished;
22
+ var _d = React.useContext(context.ConfirmationContext), alignContent = _d.alignContent, titleTag = _d.titleTag, texts = _d.texts, tempBlockDuration = _d.tempBlockDuration, onChangeScreen = _d.onChangeScreen, onTempBlockFinished = _d.onTempBlockFinished;
23
23
  var _e = utils.useCountdown(tempBlockDuration), timeLeft = _e[0], startTimer = _e[1];
24
24
  React.useEffect(function () {
25
25
  startTimer();
@@ -30,7 +30,7 @@ var TempBlock = function (_a) {
30
30
  }
31
31
  }, [timeLeft, onChangeScreen, onTempBlockFinished]);
32
32
  return (React__default.default.createElement("div", { className: cn__default.default(index_module.component, index_module[alignContent]) },
33
- React__default.default.createElement(component.Header, { mobile: mobile }, texts.tempBlockTitle),
33
+ React__default.default.createElement(component.Header, { mobile: mobile, titleTag: titleTag }, texts.tempBlockTitle),
34
34
  React__default.default.createElement(coreComponentsTypography.Text, { view: 'primary-medium', color: 'primary', className: cn__default.default(index_module.description, (_b = {},
35
35
  _b[index_module.typographyTheme] = !mobile,
36
36
  _b[index_module.typographyThemeMobile] = mobile,
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/components/screens/temp-block/component.tsx"],"sourcesContent":["import React, { FC, useContext, useEffect } from 'react';\nimport cn from 'classnames';\n\nimport { Text } from '@alfalab/core-components-typography';\n\nimport { ConfirmationContext } from '../../../context';\nimport { formatMsAsMinutes, useCountdown } from '../../../utils';\nimport { CountdownLoader } from '../../countdown-loader';\nimport { Header } from '../../header';\n\nimport styles from './index.module.css';\n\nexport type TempBlockProps = {\n /**\n * Отображать в мобильной версии экран компонента\n */\n mobile?: boolean;\n};\n\nexport const TempBlock: FC<TempBlockProps> = ({ mobile }) => {\n const { alignContent, texts, tempBlockDuration, onChangeScreen, onTempBlockFinished } =\n useContext(ConfirmationContext);\n\n const [timeLeft, startTimer] = useCountdown(tempBlockDuration);\n\n useEffect(() => {\n startTimer();\n }, [startTimer]);\n\n useEffect(() => {\n if (timeLeft === 0 && onTempBlockFinished) {\n onTempBlockFinished();\n }\n }, [timeLeft, onChangeScreen, onTempBlockFinished]);\n\n return (\n <div className={cn(styles.component, styles[alignContent])}>\n <Header mobile={mobile}>{texts.tempBlockTitle}</Header>\n\n <Text\n view='primary-medium'\n color='primary'\n className={cn(styles.description, {\n [styles.typographyTheme]: !mobile,\n [styles.typographyThemeMobile]: mobile,\n })}\n >\n {texts.tempBlockDescription}\n </Text>\n\n <div className={cn(styles.countdownWrap, { [styles.typographyTheme]: !mobile })}>\n <CountdownLoader\n progress={1 - timeLeft / tempBlockDuration}\n className={styles.loader}\n />\n <time className={styles.timeCounter}>{formatMsAsMinutes(timeLeft)}</time>\n </div>\n </div>\n );\n};\n"],"names":["useContext","ConfirmationContext","useCountdown","useEffect","React","cn","styles","Header","Text","CountdownLoader","formatMsAsMinutes"],"mappings":";;;;;;;;;;;;;;;;;;AAmBO,IAAM,SAAS,GAAuB,UAAC,EAAU,EAAA;;AAAR,IAAA,IAAA,MAAM,GAAA,EAAA,CAAA,MAAA;IAC5C,IAAA,EAAA,GACFA,gBAAU,CAACC,2BAAmB,CAAC,EAD3B,YAAY,kBAAA,EAAE,KAAK,WAAA,EAAE,iBAAiB,uBAAA,EAAE,cAAc,oBAAA,EAAE,mBAAmB,yBAChD;IAE7B,IAAA,EAAA,GAAyBC,kBAAY,CAAC,iBAAiB,CAAC,EAAvD,QAAQ,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,UAA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iB,EAC1C,SAAS,EAAEH,YAAM,CAAC,MAAM,EAC1B,CAAA;AACF,YAAAF,sBAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAEE,YAAM,CAAC,WAAW,EAAG,EAAAI,uBAAiB,CAAC,QAAQ,CAAC,CAAQ,CACvE,CACJ;AAEd;;;;"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/components/screens/temp-block/component.tsx"],"sourcesContent":["import React, { type FC, useContext, useEffect } from 'react';\nimport cn from 'classnames';\n\nimport { Text } from '@alfalab/core-components-typography';\n\nimport { ConfirmationContext } from '../../../context';\nimport { formatMsAsMinutes, useCountdown } from '../../../utils';\nimport { CountdownLoader } from '../../countdown-loader';\nimport { Header } from '../../header';\n\nimport styles from './index.module.css';\n\nexport type TempBlockProps = {\n /**\n * Отображать в мобильной версии экран компонента\n */\n mobile?: boolean;\n};\n\nexport const TempBlock: FC<TempBlockProps> = ({ mobile }) => {\n const {\n alignContent,\n titleTag,\n texts,\n tempBlockDuration,\n onChangeScreen,\n onTempBlockFinished,\n } = useContext(ConfirmationContext);\n\n const [timeLeft, startTimer] = useCountdown(tempBlockDuration);\n\n useEffect(() => {\n startTimer();\n }, [startTimer]);\n\n useEffect(() => {\n if (timeLeft === 0 && onTempBlockFinished) {\n onTempBlockFinished();\n }\n }, [timeLeft, onChangeScreen, onTempBlockFinished]);\n\n return (\n <div className={cn(styles.component, styles[alignContent])}>\n <Header mobile={mobile} titleTag={titleTag}>\n {texts.tempBlockTitle}\n </Header>\n\n <Text\n view='primary-medium'\n color='primary'\n className={cn(styles.description, {\n [styles.typographyTheme]: !mobile,\n [styles.typographyThemeMobile]: mobile,\n })}\n >\n {texts.tempBlockDescription}\n </Text>\n\n <div className={cn(styles.countdownWrap, { [styles.typographyTheme]: !mobile })}>\n <CountdownLoader\n progress={1 - timeLeft / tempBlockDuration}\n className={styles.loader}\n />\n <time className={styles.timeCounter}>{formatMsAsMinutes(timeLeft)}</time>\n </div>\n </div>\n );\n};\n"],"names":["useContext","ConfirmationContext","useCountdown","useEffect","React","cn","styles","Header","Text","CountdownLoader","formatMsAsMinutes"],"mappings":";;;;;;;;;;;;;;;;;;AAmBO,IAAM,SAAS,GAAuB,UAAC,EAAU,EAAA;;AAAR,IAAA,IAAA,MAAM,GAAA,EAAA,CAAA,MAAA;IAC5C,IAAA,EAAA,GAOFA,gBAAU,CAACC,2BAAmB,CAAC,EAN/B,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,iBAAiB,GAAA,EAAA,CAAA,iBAAA,EACjB,cAAc,GAAA,EAAA,CAAA,cAAA,EACd,mBAAmB,GAAA,EAAA,CAAA,mBACY;IAE7B,IAAA,EAAA,GAAyBC,kBAAY,CAAC,iBAAiB,CAAC,EAAvD,QAAQ,GAAA,EAAA,CAAA,CAAA,CAAA,EAAE,UAAU,GAAA,EAAA,CAAA,CAAA,CAAmC;AAE9D,IAAAC,eAAS,CAAC,YAAA;AACN,QAAA,UAAU,EAAE;AAChB,KAAC,EAAE,CAAC,UAAU,CAAC,CAAC;AAEhB,IAAAA,eAAS,CAAC,YAAA;AACN,QAAA,IAAI,QAAQ,KAAK,CAAC,IAAI,mBAAmB,EAAE;AACvC,YAAA,mBAAmB,EAAE;AACxB;KACJ,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,mBAAmB,CAAC,CAAC;AAEnD,IAAA,QACIC,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEC,mBAAE,CAACC,YAAM,CAAC,SAAS,EAAEA,YAAM,CAAC,YAAY,CAAC,CAAC,EAAA;AACtD,QAAAF,sBAAA,CAAA,aAAA,CAACG,gBAAM,EAAA,EAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAA,EACrC,KAAK,CAAC,cAAc,CAChB;AAET,QAAAH,sBAAA,CAAA,aAAA,CAACI,6BAAI,EACD,EAAA,IAAI,EAAC,gBAAgB,EACrB,KAAK,EAAC,SAAS,EACf,SAAS,EAAEH,mBAAE,CAACC,YAAM,CAAC,WAAW,GAAA,EAAA,GAAA,EAAA;AAC5B,gBAAA,EAAA,CAACA,YAAM,CAAC,eAAe,CAAA,GAAG,CAAC,MAAM;AACjC,gBAAA,EAAA,CAACA,YAAM,CAAC,qBAAqB,CAAA,GAAG,MAAM;oBACxC,EAED,EAAA,KAAK,CAAC,oBAAoB,CACxB;AAEP,QAAAF,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEC,mBAAE,CAACC,YAAM,CAAC,aAAa,GAAI,EAAA,GAAA,EAAA,EAAA,EAAA,CAACA,YAAM,CAAC,eAAe,CAAG,GAAA,CAAC,MAAM,EAAG,EAAA,EAAA,EAAA;AAC3E,YAAAF,sBAAA,CAAA,aAAA,CAACK,2BAAe,EAAA,EACZ,QAAQ,EAAE,CAAC,GAAG,QAAQ,GAAG,iBAAiB,EAC1C,SAAS,EAAEH,YAAM,CAAC,MAAM,EAC1B,CAAA;AACF,YAAAF,sBAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAEE,YAAM,CAAC,WAAW,EAAG,EAAAI,uBAAiB,CAAC,QAAQ,CAAC,CAAQ,CACvE,CACJ;AAEd;;;;"}
@@ -5,42 +5,40 @@
5
5
  --gap-xs: 8px;
6
6
  --gap-8: var(--gap-xs);
7
7
  } :root {
8
- --font-family-system: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica,
9
- sans-serif;
8
+ --font-family-system:
9
+ system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, sans-serif;
10
10
  } :root {
11
11
  --confirmation-text-font-size: 16px;
12
12
  --confirmation-text-line-height: 24px;
13
13
  --confirmation-text-font-weight: 400;
14
14
  --confirmation-text-font-family: var(--font-family-system);
15
15
  --confirmation-text-color: var(--color-light-text-primary)
16
-
17
- /* header */
18
- } .confirmation__component_vppvo {
16
+ } .confirmation__component_10jl7 {
19
17
  display: flex;
20
18
  flex-direction: column;
21
- } .confirmation__center_vppvo {
19
+ } .confirmation__center_10jl7 {
22
20
  align-items: center;
23
21
  text-align: center;
24
- } .confirmation__typographyTheme_vppvo.confirmation__typographyTheme_vppvo {
22
+ } .confirmation__typographyTheme_10jl7.confirmation__typographyTheme_10jl7 {
25
23
  font-size: var(--confirmation-text-font-size);
26
24
  line-height: var(--confirmation-text-line-height);
27
25
  font-weight: var(--confirmation-text-font-weight);
28
26
  font-family: var(--confirmation-text-font-family);
29
27
  color: var(--confirmation-text-color);
30
- } .confirmation__typographyThemeMobile_vppvo.confirmation__typographyThemeMobile_vppvo {
28
+ } .confirmation__typographyThemeMobile_10jl7.confirmation__typographyThemeMobile_10jl7 {
31
29
  color: var(--color-light-text-secondary);
32
- } .confirmation__description_vppvo.confirmation__description_vppvo {
30
+ } .confirmation__description_10jl7.confirmation__description_10jl7 {
33
31
  margin-bottom: var(--gap-8);
34
- } .confirmation__countdownWrap_vppvo {
32
+ } .confirmation__countdownWrap_10jl7 {
35
33
  display: flex;
36
34
  align-items: center;
37
- } .confirmation__timeCounter_vppvo {
35
+ } .confirmation__timeCounter_10jl7 {
38
36
  display: inline-block;
39
37
  min-width: 47px;
40
38
  color: var(--color-light-text-secondary);
41
39
  text-align: left;
42
40
  font-feature-settings: lining-nums tabular-nums;
43
41
  font-variant-numeric: lining-nums tabular-nums;
44
- } .confirmation__loader_vppvo {
42
+ } .confirmation__loader_10jl7 {
45
43
  margin-right: var(--gap-8);
46
44
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./index.css');
4
4
 
5
- var styles = {"component":"confirmation__component_vppvo","center":"confirmation__center_vppvo","typographyTheme":"confirmation__typographyTheme_vppvo","typographyThemeMobile":"confirmation__typographyThemeMobile_vppvo","description":"confirmation__description_vppvo","countdownWrap":"confirmation__countdownWrap_vppvo","timeCounter":"confirmation__timeCounter_vppvo","loader":"confirmation__loader_vppvo"};
5
+ var styles = {"component":"confirmation__component_10jl7","center":"confirmation__center_10jl7","typographyTheme":"confirmation__typographyTheme_10jl7","typographyThemeMobile":"confirmation__typographyThemeMobile_10jl7","description":"confirmation__description_10jl7","countdownWrap":"confirmation__countdownWrap_10jl7","timeCounter":"confirmation__timeCounter_10jl7","loader":"confirmation__loader_10jl7"};
6
6
 
7
7
  module.exports = styles;
8
8
  //# sourceMappingURL=index.module.css.js.map
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import { type FC } from 'react';
2
2
  export declare type TempBlockOverProps = {
3
3
  /**
4
4
  * Отображать в мобильной версии экран компонента
@@ -18,13 +18,13 @@ var cn__default = /*#__PURE__*/_interopDefaultCompat(cn);
18
18
  var TempBlockOver = function (_a) {
19
19
  var _b;
20
20
  var mobile = _a.mobile;
21
- var _c = React.useContext(context.ConfirmationContext), alignContent = _c.alignContent, texts = _c.texts, breakpoint = _c.breakpoint, client = _c.client, onChangeScreen = _c.onChangeScreen, onChangeState = _c.onChangeState;
21
+ var _c = React.useContext(context.ConfirmationContext), alignContent = _c.alignContent, titleTag = _c.titleTag, texts = _c.texts, breakpoint = _c.breakpoint, client = _c.client, onChangeScreen = _c.onChangeScreen, onChangeState = _c.onChangeState;
22
22
  var handleReturnButtonClick = function () {
23
23
  onChangeScreen('INITIAL');
24
24
  onChangeState('INITIAL');
25
25
  };
26
26
  return (React__default.default.createElement("div", { className: cn__default.default(index_module.component, index_module[alignContent]) },
27
- React__default.default.createElement(component.Header, { mobile: mobile }, texts.tempBlockOverTitle),
27
+ React__default.default.createElement(component.Header, { mobile: mobile, titleTag: titleTag }, texts.tempBlockOverTitle),
28
28
  React__default.default.createElement(coreComponentsTypography.Text, { view: 'primary-medium', color: 'primary', className: cn__default.default(index_module.description, (_b = {},
29
29
  _b[index_module.typographyTheme] = !mobile,
30
30
  _b[index_module.typographyThemeMobile] = mobile,
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/components/screens/temp-block-over/component.tsx"],"sourcesContent":["import React, { FC, useContext } from 'react';\nimport cn from 'classnames';\n\nimport { Button } from '@alfalab/core-components-button';\nimport { Text } from '@alfalab/core-components-typography';\n\nimport { ConfirmationContext } from '../../../context';\nimport { Header } from '../../header';\n\nimport styles from './index.module.css';\n\nexport type TempBlockOverProps = {\n /**\n * Отображать в мобильной версии экран компонента\n */\n mobile?: boolean;\n};\n\nexport const TempBlockOver: FC<TempBlockOverProps> = ({ mobile }) => {\n const { alignContent, texts, breakpoint, client, onChangeScreen, onChangeState } =\n useContext(ConfirmationContext);\n\n const handleReturnButtonClick = () => {\n onChangeScreen('INITIAL');\n onChangeState('INITIAL');\n };\n\n return (\n <div className={cn(styles.component, styles[alignContent])}>\n <Header mobile={mobile}>{texts.tempBlockOverTitle}</Header>\n\n <Text\n view='primary-medium'\n color='primary'\n className={cn(styles.description, {\n [styles.typographyTheme]: !mobile,\n [styles.typographyThemeMobile]: mobile,\n })}\n >\n {texts.tempBlockOverDescription}\n </Text>\n\n <Button\n size={mobile ? 'xs' : 's'}\n view='secondary'\n onClick={handleReturnButtonClick}\n className={styles.button}\n breakpoint={breakpoint}\n client={client}\n >\n {texts.tempBlockOverButton}\n </Button>\n </div>\n );\n};\n"],"names":["useContext","ConfirmationContext","React","cn","styles","Header","Text","Button"],"mappings":";;;;;;;;;;;;;;;;;AAkBO,IAAM,aAAa,GAA2B,UAAC,EAAU,EAAA;;AAAR,IAAA,IAAA,MAAM,GAAA,EAAA,CAAA,MAAA;IACpD,IAAA,EAAA,GACFA,gBAAU,CAACC,2BAAmB,CAAC,EAD3B,YAAY,GAAA,EAAA,CAAA,YAAA,EAAE,KAAK,GAAA,EAAA,CAAA,KAAA,EAAE,UAAU,GAAA,EAAA,CAAA,UAAA,EAAE,MAAM,GAAA,EAAA,CAAA,MAAA,EAAE,cAAc,GAAA,EAAA,CAAA,cAAA,EAAE,aAAa,GAAA,EAAA,CAAA,aAC3C;AAEnC,IAAA,IAAM,uBAAuB,GAAG,YAAA;QAC5B,cAAc,CAAC,SAAS,CAAC;QACzB,aAAa,CAAC,SAAS,CAAC;AAC5B,KAAC;AAED,IAAA,QACIC,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEC,mBAAE,CAACC,YAAM,CAAC,SAAS,EAAEA,YAAM,CAAC,YAAY,CAAC,CAAC,EAAA;QACtDF,sBAAC,CAAA,aAAA,CAAAG,gBAAM,IAAC,MAAM,EAAE,MAAM,EAAG,EAAA,KAAK,CAAC,kBAAkB,CAAU;AAE3D,QAAAH,sBAAA,CAAA,aAAA,CAACI,6BAAI,EACD,EAAA,IAAI,EAAC,gBAAgB,EACrB,KAAK,EAAC,SAAS,EACf,SAAS,EAAEH,mBAAE,CAACC,YAAM,CAAC,WAAW,GAAA,EAAA,GAAA,EAAA;AAC5B,gBAAA,EAAA,CAACA,YAAM,CAAC,eAAe,CAAA,GAAG,CAAC,MAAM;AACjC,gBAAA,EAAA,CAACA,YAAM,CAAC,qBAAqB,CAAA,GAAG,MAAM;oBACxC,EAED,EAAA,KAAK,CAAC,wBAAwB,CAC5B;AAEP,QAAAF,sBAAA,CAAA,aAAA,CAACK,2BAAM,EACH,EAAA,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,GAAG,EACzB,IAAI,EAAC,WAAW,EAChB,OAAO,EAAE,uBAAuB,EAChC,SAAS,EAAEH,YAAM,CAAC,MAAM,EACxB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,IAEb,KAAK,CAAC,mBAAmB,CACrB,CACP;AAEd;;;;"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/components/screens/temp-block-over/component.tsx"],"sourcesContent":["import React, { type FC, useContext } from 'react';\nimport cn from 'classnames';\n\nimport { Button } from '@alfalab/core-components-button';\nimport { Text } from '@alfalab/core-components-typography';\n\nimport { ConfirmationContext } from '../../../context';\nimport { Header } from '../../header';\n\nimport styles from './index.module.css';\n\nexport type TempBlockOverProps = {\n /**\n * Отображать в мобильной версии экран компонента\n */\n mobile?: boolean;\n};\n\nexport const TempBlockOver: FC<TempBlockOverProps> = ({ mobile }) => {\n const { alignContent, titleTag, texts, breakpoint, client, onChangeScreen, onChangeState } =\n useContext(ConfirmationContext);\n\n const handleReturnButtonClick = () => {\n onChangeScreen('INITIAL');\n onChangeState('INITIAL');\n };\n\n return (\n <div className={cn(styles.component, styles[alignContent])}>\n <Header mobile={mobile} titleTag={titleTag}>\n {texts.tempBlockOverTitle}\n </Header>\n\n <Text\n view='primary-medium'\n color='primary'\n className={cn(styles.description, {\n [styles.typographyTheme]: !mobile,\n [styles.typographyThemeMobile]: mobile,\n })}\n >\n {texts.tempBlockOverDescription}\n </Text>\n\n <Button\n size={mobile ? 'xs' : 's'}\n view='secondary'\n onClick={handleReturnButtonClick}\n className={styles.button}\n breakpoint={breakpoint}\n client={client}\n >\n {texts.tempBlockOverButton}\n </Button>\n </div>\n );\n};\n"],"names":["useContext","ConfirmationContext","React","cn","styles","Header","Text","Button"],"mappings":";;;;;;;;;;;;;;;;;AAkBO,IAAM,aAAa,GAA2B,UAAC,EAAU,EAAA;;AAAR,IAAA,IAAA,MAAM,GAAA,EAAA,CAAA,MAAA;IACpD,IAAA,EAAA,GACFA,gBAAU,CAACC,2BAAmB,CAAC,EAD3B,YAAY,GAAA,EAAA,CAAA,YAAA,EAAE,QAAQ,GAAA,EAAA,CAAA,QAAA,EAAE,KAAK,WAAA,EAAE,UAAU,GAAA,EAAA,CAAA,UAAA,EAAE,MAAM,GAAA,EAAA,CAAA,MAAA,EAAE,cAAc,GAAA,EAAA,CAAA,cAAA,EAAE,aAAa,GAAA,EAAA,CAAA,aACrD;AAEnC,IAAA,IAAM,uBAAuB,GAAG,YAAA;QAC5B,cAAc,CAAC,SAAS,CAAC;QACzB,aAAa,CAAC,SAAS,CAAC;AAC5B,KAAC;AAED,IAAA,QACIC,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEC,mBAAE,CAACC,YAAM,CAAC,SAAS,EAAEA,YAAM,CAAC,YAAY,CAAC,CAAC,EAAA;AACtD,QAAAF,sBAAA,CAAA,aAAA,CAACG,gBAAM,EAAA,EAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAA,EACrC,KAAK,CAAC,kBAAkB,CACpB;AAET,QAAAH,sBAAA,CAAA,aAAA,CAACI,6BAAI,EACD,EAAA,IAAI,EAAC,gBAAgB,EACrB,KAAK,EAAC,SAAS,EACf,SAAS,EAAEH,mBAAE,CAACC,YAAM,CAAC,WAAW,GAAA,EAAA,GAAA,EAAA;AAC5B,gBAAA,EAAA,CAACA,YAAM,CAAC,eAAe,CAAA,GAAG,CAAC,MAAM;AACjC,gBAAA,EAAA,CAACA,YAAM,CAAC,qBAAqB,CAAA,GAAG,MAAM;oBACxC,EAED,EAAA,KAAK,CAAC,wBAAwB,CAC5B;AAEP,QAAAF,sBAAA,CAAA,aAAA,CAACK,2BAAM,EACH,EAAA,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,GAAG,EACzB,IAAI,EAAC,WAAW,EAChB,OAAO,EAAE,uBAAuB,EAChC,SAAS,EAAEH,YAAM,CAAC,MAAM,EACxB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,IAEb,KAAK,CAAC,mBAAmB,CACrB,CACP;AAEd;;;;"}
@@ -5,30 +5,28 @@
5
5
  --gap-2xl: 32px;
6
6
  --gap-32: var(--gap-2xl);
7
7
  } :root {
8
- --font-family-system: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica,
9
- sans-serif;
8
+ --font-family-system:
9
+ system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, sans-serif;
10
10
  } :root {
11
11
  --confirmation-text-font-size: 16px;
12
12
  --confirmation-text-line-height: 24px;
13
13
  --confirmation-text-font-weight: 400;
14
14
  --confirmation-text-font-family: var(--font-family-system);
15
15
  --confirmation-text-color: var(--color-light-text-primary)
16
-
17
- /* header */
18
- } .confirmation__component_1biyi {
16
+ } .confirmation__component_1a8b9 {
19
17
  display: flex;
20
18
  flex-direction: column;
21
- } .confirmation__center_1biyi {
19
+ } .confirmation__center_1a8b9 {
22
20
  align-items: center;
23
21
  text-align: center;
24
- } .confirmation__typographyTheme_1biyi.confirmation__typographyTheme_1biyi {
22
+ } .confirmation__typographyTheme_1a8b9.confirmation__typographyTheme_1a8b9 {
25
23
  font-size: var(--confirmation-text-font-size);
26
24
  line-height: var(--confirmation-text-line-height);
27
25
  font-weight: var(--confirmation-text-font-weight);
28
26
  font-family: var(--confirmation-text-font-family);
29
27
  color: var(--confirmation-text-color);
30
- } .confirmation__typographyThemeMobile_1biyi.confirmation__typographyThemeMobile_1biyi {
28
+ } .confirmation__typographyThemeMobile_1a8b9.confirmation__typographyThemeMobile_1a8b9 {
31
29
  color: var(--color-light-text-secondary);
32
- } .confirmation__button_1biyi.confirmation__button_1biyi {
30
+ } .confirmation__button_1a8b9.confirmation__button_1a8b9 {
33
31
  margin-top: var(--gap-32);
34
32
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./index.css');
4
4
 
5
- var styles = {"component":"confirmation__component_1biyi","center":"confirmation__center_1biyi","typographyTheme":"confirmation__typographyTheme_1biyi","typographyThemeMobile":"confirmation__typographyThemeMobile_1biyi","button":"confirmation__button_1biyi"};
5
+ var styles = {"component":"confirmation__component_1a8b9","center":"confirmation__center_1a8b9","typographyTheme":"confirmation__typographyTheme_1a8b9","typographyThemeMobile":"confirmation__typographyThemeMobile_1a8b9","button":"confirmation__button_1a8b9"};
6
6
 
7
7
  module.exports = styles;
8
8
  //# sourceMappingURL=index.module.css.js.map
package/context.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" />
2
- import { TConfirmationContext } from './types';
2
+ import { type TConfirmationContext } from './types';
3
3
  export declare const ConfirmationContext: import("react").Context<TConfirmationContext>;
package/context.js CHANGED
@@ -8,6 +8,7 @@ var utils = require('./utils.js');
8
8
  var mockFn = function () { return undefined; };
9
9
  var ConfirmationContext = React.createContext({
10
10
  alignContent: 'left',
11
+ titleTag: 'h3',
11
12
  texts: {},
12
13
  state: 'INITIAL',
13
14
  screen: 'INITIAL',
package/context.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sources":["src/context.ts"],"sourcesContent":["import { createContext } from 'react';\n\nimport { TConfirmationContext } from './types';\nimport { ONE_DAY, ONE_MINUTE } from './utils';\n\nconst mockFn = () => undefined;\n\nexport const ConfirmationContext = createContext<TConfirmationContext>({\n alignContent: 'left',\n texts: {},\n state: 'INITIAL',\n screen: 'INITIAL',\n requiredCharAmount: 5,\n countdownDuration: ONE_MINUTE,\n timeLeft: ONE_MINUTE,\n tempBlockDuration: ONE_DAY,\n phone: '',\n hideCountdownSection: false,\n breakpoint: 1024,\n client: 'desktop',\n initialScreenHintSlot: null,\n onTempBlockFinished: mockFn,\n onInputFinished: mockFn,\n onChangeState: mockFn,\n onSmsRetryClick: mockFn,\n onChangeScreen: mockFn,\n onFatalErrorOkButtonClick: mockFn,\n});\n"],"names":["createContext","ONE_MINUTE","ONE_DAY"],"mappings":";;;;;;;AAKA,IAAM,MAAM,GAAG,YAAA,EAAM,OAAA,SAAS,CAAA,EAAA;AAEvB,IAAM,mBAAmB,GAAGA,mBAAa,CAAuB;AACnE,IAAA,YAAY,EAAE,MAAM;AACpB,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,kBAAkB,EAAE,CAAC;AACrB,IAAA,iBAAiB,EAAEC,gBAAU;AAC7B,IAAA,QAAQ,EAAEA,gBAAU;AACpB,IAAA,iBAAiB,EAAEC,aAAO;AAC1B,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,oBAAoB,EAAE,KAAK;AAC3B,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,qBAAqB,EAAE,IAAI;AAC3B,IAAA,mBAAmB,EAAE,MAAM;AAC3B,IAAA,eAAe,EAAE,MAAM;AACvB,IAAA,aAAa,EAAE,MAAM;AACrB,IAAA,eAAe,EAAE,MAAM;AACvB,IAAA,cAAc,EAAE,MAAM;AACtB,IAAA,yBAAyB,EAAE,MAAM;AACpC,CAAA;;;;"}
1
+ {"version":3,"file":"context.js","sources":["src/context.ts"],"sourcesContent":["import { createContext } from 'react';\n\nimport { type TConfirmationContext } from './types';\nimport { ONE_DAY, ONE_MINUTE } from './utils';\n\nconst mockFn = () => undefined;\n\nexport const ConfirmationContext = createContext<TConfirmationContext>({\n alignContent: 'left',\n titleTag: 'h3',\n texts: {},\n state: 'INITIAL',\n screen: 'INITIAL',\n requiredCharAmount: 5,\n countdownDuration: ONE_MINUTE,\n timeLeft: ONE_MINUTE,\n tempBlockDuration: ONE_DAY,\n phone: '',\n hideCountdownSection: false,\n breakpoint: 1024,\n client: 'desktop',\n initialScreenHintSlot: null,\n onTempBlockFinished: mockFn,\n onInputFinished: mockFn,\n onChangeState: mockFn,\n onSmsRetryClick: mockFn,\n onChangeScreen: mockFn,\n onFatalErrorOkButtonClick: mockFn,\n});\n"],"names":["createContext","ONE_MINUTE","ONE_DAY"],"mappings":";;;;;;;AAKA,IAAM,MAAM,GAAG,YAAA,EAAM,OAAA,SAAS,CAAA,EAAA;AAEvB,IAAM,mBAAmB,GAAGA,mBAAa,CAAuB;AACnE,IAAA,YAAY,EAAE,MAAM;AACpB,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,kBAAkB,EAAE,CAAC;AACrB,IAAA,iBAAiB,EAAEC,gBAAU;AAC7B,IAAA,QAAQ,EAAEA,gBAAU;AACpB,IAAA,iBAAiB,EAAEC,aAAO;AAC1B,IAAA,KAAK,EAAE,EAAE;AACT,IAAA,oBAAoB,EAAE,KAAK;AAC3B,IAAA,UAAU,EAAE,IAAI;AAChB,IAAA,MAAM,EAAE,SAAS;AACjB,IAAA,qBAAqB,EAAE,IAAI;AAC3B,IAAA,mBAAmB,EAAE,MAAM;AAC3B,IAAA,eAAe,EAAE,MAAM;AACvB,IAAA,aAAa,EAAE,MAAM;AACrB,IAAA,eAAe,EAAE,MAAM;AACvB,IAAA,cAAc,EAAE,MAAM;AACtB,IAAA,yBAAyB,EAAE,MAAM;AACpC,CAAA;;;;"}
@@ -1,5 +1,5 @@
1
- import { FC } from 'react';
2
- import { ConfirmationProps } from './types';
1
+ import { type FC } from 'react';
2
+ import { type ConfirmationProps } from './types';
3
3
  export declare type ResponsiveConfirmationProps = Omit<ConfirmationProps, 'confirmationScreens' | 'breakpoint'> & {
4
4
  /**
5
5
  * Контрольная точка, с нее начинается desktop версия
@@ -1 +1 @@
1
- {"version":3,"file":"component.responsive.js","sources":["../src/component.responsive.tsx"],"sourcesContent":["import React, { FC } from 'react';\n\nimport { useIsDesktop } from '@alfalab/core-components-mq';\n\nimport { ConfirmationDesktop } from './desktop';\nimport { ConfirmationMobile } from './mobile';\nimport { ConfirmationProps } from './types';\n\nexport type ResponsiveConfirmationProps = Omit<\n ConfirmationProps,\n 'confirmationScreens' | 'breakpoint'\n> & {\n /**\n * Контрольная точка, с нее начинается desktop версия\n * @default 1024\n */\n breakpoint?: number;\n\n /**\n * Версия, которая будет использоваться при серверном рендеринге\n */\n client?: 'desktop' | 'mobile';\n\n /**\n * Значение по-умолчанию для хука useMatchMedia\n * @deprecated Используйте client\n */\n defaultMatchMediaValue?: boolean | (() => boolean);\n};\n\nexport const ConfirmationResponsive: FC<ResponsiveConfirmationProps> = ({\n breakpoint,\n client,\n defaultMatchMediaValue = client === undefined ? undefined : client === 'desktop',\n ...restProps\n}) => {\n const isDesktop = useIsDesktop(breakpoint, defaultMatchMediaValue);\n\n return isDesktop ? (\n <ConfirmationDesktop {...restProps} />\n ) : (\n <ConfirmationMobile breakpoint={breakpoint} {...restProps} />\n );\n};\n"],"names":["__rest","useIsDesktop","React","ConfirmationDesktop","__assign","ConfirmationMobile"],"mappings":";;;;;;;;;;;;;;AA8BO,IAAM,sBAAsB,GAAoC,UAAC,EAKvE,EAAA;AAJG,IAAA,IAAA,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,EAAgF,GAAA,EAAA,CAAA,sBAAA,EAAhF,sBAAsB,GAAA,EAAA,KAAA,MAAA,GAAG,MAAM,KAAK,SAAS,GAAG,SAAS,GAAG,MAAM,KAAK,SAAS,GAAA,EAAA,EAC7E,SAAS,GAJwDA,YAAA,CAAA,EAAA,EAAA,CAAA,YAAA,EAAA,QAAA,EAAA,wBAAA,CAKvE,CADe;IAEZ,IAAM,SAAS,GAAGC,iBAAY,CAAC,UAAU,EAAE,sBAAsB,CAAC;IAElE,OAAO,SAAS,IACZC,qCAACC,qCAAmB,EAAAC,cAAA,CAAA,EAAA,EAAK,SAAS,CAAA,CAAI,KAEtCF,sBAAC,CAAA,aAAA,CAAAG,mCAAkB,EAACD,cAAA,CAAA,EAAA,UAAU,EAAE,UAAU,EAAM,EAAA,SAAS,CAAI,CAAA,CAChE;AACL;;;;"}
1
+ {"version":3,"file":"component.responsive.js","sources":["../src/component.responsive.tsx"],"sourcesContent":["import React, { type FC } from 'react';\n\nimport { useIsDesktop } from '@alfalab/core-components-mq';\n\nimport { ConfirmationDesktop } from './desktop';\nimport { ConfirmationMobile } from './mobile';\nimport { type ConfirmationProps } from './types';\n\nexport type ResponsiveConfirmationProps = Omit<\n ConfirmationProps,\n 'confirmationScreens' | 'breakpoint'\n> & {\n /**\n * Контрольная точка, с нее начинается desktop версия\n * @default 1024\n */\n breakpoint?: number;\n\n /**\n * Версия, которая будет использоваться при серверном рендеринге\n */\n client?: 'desktop' | 'mobile';\n\n /**\n * Значение по-умолчанию для хука useMatchMedia\n * @deprecated Используйте client\n */\n defaultMatchMediaValue?: boolean | (() => boolean);\n};\n\nexport const ConfirmationResponsive: FC<ResponsiveConfirmationProps> = ({\n breakpoint,\n client,\n defaultMatchMediaValue = client === undefined ? undefined : client === 'desktop',\n ...restProps\n}) => {\n const isDesktop = useIsDesktop(breakpoint, defaultMatchMediaValue);\n\n return isDesktop ? (\n <ConfirmationDesktop {...restProps} />\n ) : (\n <ConfirmationMobile breakpoint={breakpoint} {...restProps} />\n );\n};\n"],"names":["__rest","useIsDesktop","React","ConfirmationDesktop","__assign","ConfirmationMobile"],"mappings":";;;;;;;;;;;;;;AA8BO,IAAM,sBAAsB,GAAoC,UAAC,EAKvE,EAAA;AAJG,IAAA,IAAA,UAAU,GAAA,EAAA,CAAA,UAAA,EACV,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,EAAgF,GAAA,EAAA,CAAA,sBAAA,EAAhF,sBAAsB,GAAA,EAAA,KAAA,MAAA,GAAG,MAAM,KAAK,SAAS,GAAG,SAAS,GAAG,MAAM,KAAK,SAAS,GAAA,EAAA,EAC7E,SAAS,GAJwDA,YAAA,CAAA,EAAA,EAAA,CAAA,YAAA,EAAA,QAAA,EAAA,wBAAA,CAKvE,CADe;IAEZ,IAAM,SAAS,GAAGC,iBAAY,CAAC,UAAU,EAAE,sBAAsB,CAAC;IAElE,OAAO,SAAS,IACZC,qCAACC,qCAAmB,EAAAC,cAAA,CAAA,EAAA,EAAK,SAAS,CAAA,CAAI,KAEtCF,sBAAC,CAAA,aAAA,CAAAG,mCAAkB,EAACD,cAAA,CAAA,EAAA,UAAU,EAAE,UAAU,EAAM,EAAA,SAAS,CAAI,CAAA,CAChE;AACL;;;;"}
@@ -1,3 +1,3 @@
1
- import { FC } from 'react';
2
- import { ConfirmationProps } from '../../types';
1
+ import { type FC } from 'react';
2
+ import { type ConfirmationProps } from '../../types';
3
3
  export declare const BaseConfirmation: FC<ConfirmationProps>;
@@ -31,8 +31,8 @@ var confirmationScreens = {
31
31
  };
32
32
  var BaseConfirmation = function (_a) {
33
33
  var _b;
34
- var state = _a.state, screen = _a.screen, _c = _a.alignContent, alignContent = _c === void 0 ? 'left' : _c; _a.children; var _d = _a.requiredCharAmount, requiredCharAmount = _d === void 0 ? 5 : _d, _e = _a.countdownDuration, countdownDuration = _e === void 0 ? utils.ONE_MINUTE : _e, _f = _a.tempBlockDuration, tempBlockDuration = _f === void 0 ? utils.ONE_DAY : _f, 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, _g = _a.clearCodeOnError, clearCodeOnError = _g === void 0 ? true : _g, _h = _a.hideCountdownSection, hideCountdownSection = _h === void 0 ? false : _h, breakpoint = _a.breakpoint, client = _a.client, initialScreenHintSlot = _a.initialScreenHintSlot, errorVisibleDuration = _a.errorVisibleDuration, restProps = tslib.__rest(_a, ["state", "screen", "alignContent", "children", "requiredCharAmount", "countdownDuration", "tempBlockDuration", "phone", "blockSmsRetry", "dataTestId", "className", "getScreensMap", "onInputFinished", "onChangeState", "onSmsRetryClick", "onChangeScreen", "onFatalErrorOkButtonClick", "onTempBlockFinished", "mobile", "clearCodeOnError", "hideCountdownSection", "breakpoint", "client", "initialScreenHintSlot", "errorVisibleDuration"]);
35
- var _j = utils.useCountdown(countdownDuration), timeLeft = _j[0], startTimer = _j[1], stopTimer = _j[2];
34
+ var state = _a.state, screen = _a.screen, _c = _a.titleTag, titleTag = _c === void 0 ? 'h3' : _c, _d = _a.alignContent, alignContent = _d === void 0 ? 'left' : _d; _a.children; var _e = _a.requiredCharAmount, requiredCharAmount = _e === void 0 ? 5 : _e, _f = _a.countdownDuration, countdownDuration = _f === void 0 ? utils.ONE_MINUTE : _f, _g = _a.tempBlockDuration, tempBlockDuration = _g === void 0 ? utils.ONE_DAY : _g, 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, _h = _a.clearCodeOnError, clearCodeOnError = _h === void 0 ? true : _h, _j = _a.hideCountdownSection, hideCountdownSection = _j === void 0 ? false : _j, breakpoint = _a.breakpoint, client = _a.client, initialScreenHintSlot = _a.initialScreenHintSlot, errorVisibleDuration = _a.errorVisibleDuration, restProps = tslib.__rest(_a, ["state", "screen", "titleTag", "alignContent", "children", "requiredCharAmount", "countdownDuration", "tempBlockDuration", "phone", "blockSmsRetry", "dataTestId", "className", "getScreensMap", "onInputFinished", "onChangeState", "onSmsRetryClick", "onChangeScreen", "onFatalErrorOkButtonClick", "onTempBlockFinished", "mobile", "clearCodeOnError", "hideCountdownSection", "breakpoint", "client", "initialScreenHintSlot", "errorVisibleDuration"]);
35
+ var _k = utils.useCountdown(countdownDuration), timeLeft = _k[0], startTimer = _k[1], stopTimer = _k[2];
36
36
  var prevState = hooks.usePrevious(state);
37
37
  React.useEffect(function () {
38
38
  startTimer();
@@ -71,6 +71,7 @@ var BaseConfirmation = function (_a) {
71
71
  var contextValue = {
72
72
  hideCountdownSection: hideCountdownSection,
73
73
  alignContent: alignContent,
74
+ titleTag: titleTag,
74
75
  texts: tslib.__assign(tslib.__assign({}, types.defaultTexts), restProps.texts),
75
76
  state: state,
76
77
  screen: screen,
@@ -92,7 +93,7 @@ var BaseConfirmation = function (_a) {
92
93
  onSmsRetryClick: handleSmsRetry,
93
94
  onFatalErrorOkButtonClick: handleFatalErrorOkButtonClick,
94
95
  };
95
- var customScreen = React.useMemo(function () { return getScreensMap && getScreensMap(confirmationScreens); }, [getScreensMap]);
96
+ var customScreen = React.useMemo(function () { return getScreensMap === null || getScreensMap === void 0 ? void 0 : getScreensMap(confirmationScreens); }, [getScreensMap]);
96
97
  var screensMap = customScreen || confirmationScreens;
97
98
  var CurrentScreen = screensMap[screen];
98
99
  return (React__default.default.createElement(context.ConfirmationContext.Provider, { value: contextValue },
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/components/base-confirmation/component.tsx"],"sourcesContent":["import React, { ComponentType, FC, useEffect, useMemo } from 'react';\nimport cn from 'classnames';\n\nimport { usePrevious } from '@alfalab/hooks';\n\nimport { ConfirmationContext } from '../../context';\nimport { ConfirmationProps, defaultTexts, TConfirmationContext } from '../../types';\nimport { ONE_DAY, ONE_MINUTE, useCountdown } from '../../utils';\nimport { FatalError, Hint, Initial, TempBlock, TempBlockOver } from '../screens';\n\nimport styles from './index.module.css';\n\nconst confirmationScreens: { [key: string]: ComponentType<{ mobile?: boolean }> } = {\n INITIAL: Initial,\n HINT: Hint,\n FATAL_ERROR: FatalError,\n TEMP_BLOCK: TempBlock,\n TEMP_BLOCK_OVER: TempBlockOver,\n};\n\nexport const BaseConfirmation: FC<ConfirmationProps> = ({\n state,\n screen,\n alignContent = 'left',\n children,\n requiredCharAmount = 5,\n countdownDuration = ONE_MINUTE,\n tempBlockDuration = ONE_DAY,\n phone,\n blockSmsRetry,\n dataTestId,\n className,\n getScreensMap,\n onInputFinished,\n onChangeState,\n onSmsRetryClick,\n onChangeScreen,\n onFatalErrorOkButtonClick,\n onTempBlockFinished,\n mobile,\n clearCodeOnError = true,\n hideCountdownSection = false,\n breakpoint,\n client,\n initialScreenHintSlot,\n errorVisibleDuration,\n ...restProps\n}) => {\n const [timeLeft, startTimer, stopTimer] = useCountdown(countdownDuration);\n\n const prevState = usePrevious(state);\n\n useEffect(() => {\n startTimer();\n }, [startTimer]);\n\n useEffect(() => {\n /**\n * Перезапускаем таймер после повторного запроса кода\n */\n if (state === 'INITIAL' && prevState === 'CODE_SENDING') {\n startTimer();\n }\n }, [state, prevState, startTimer]);\n\n useEffect(() => {\n /**\n * Останавливаем таймер, если новый экран/состояние не содержит таймер\n */\n if (\n !['INITIAL', 'HINT', 'TEMP_BLOCK', 'TEMP_BLOCK_OVER'].includes(screen) ||\n blockSmsRetry\n ) {\n stopTimer();\n }\n }, [state, screen, blockSmsRetry, stopTimer]);\n\n const handleSmsRetry = () => {\n onChangeState('CODE_SENDING');\n\n onSmsRetryClick();\n };\n\n const handleInputFinished = (code: string) => {\n onChangeState('CODE_CHECKING');\n\n onInputFinished(code);\n };\n\n const handleFatalErrorOkButtonClick = () => {\n if (onFatalErrorOkButtonClick) {\n onFatalErrorOkButtonClick();\n }\n };\n\n // eslint-disable-next-line react/jsx-no-constructed-context-values\n const contextValue: TConfirmationContext = {\n hideCountdownSection,\n alignContent,\n texts: { ...defaultTexts, ...restProps.texts },\n state,\n screen,\n requiredCharAmount,\n countdownDuration,\n timeLeft,\n tempBlockDuration,\n phone,\n blockSmsRetry,\n breakpoint,\n client,\n onTempBlockFinished,\n onChangeState,\n onChangeScreen,\n clearCodeOnError,\n errorVisibleDuration,\n initialScreenHintSlot,\n onInputFinished: handleInputFinished,\n onSmsRetryClick: handleSmsRetry,\n onFatalErrorOkButtonClick: handleFatalErrorOkButtonClick,\n };\n\n const customScreen = useMemo(\n () => getScreensMap && getScreensMap(confirmationScreens),\n [getScreensMap],\n );\n\n const screensMap = customScreen || confirmationScreens;\n\n const CurrentScreen = screensMap[screen];\n\n return (\n <ConfirmationContext.Provider value={contextValue}>\n <div\n className={cn(styles.component, className, {\n [styles.center]: alignContent === 'center',\n })}\n data-test-id={dataTestId}\n >\n {CurrentScreen && <CurrentScreen mobile={mobile} />}\n </div>\n </ConfirmationContext.Provider>\n );\n};\n"],"names":["Initial","Hint","FatalError","TempBlock","TempBlockOver","ONE_MINUTE","ONE_DAY","__rest","useCountdown","usePrevious","useEffect","defaultTexts","useMemo","React","ConfirmationContext","cn","styles"],"mappings":";;;;;;;;;;;;;;;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,qBAAA;AACrB,QAAA,eAAe,EAAE,mBAAmB;AACpC,QAAA,eAAe,EAAE,cAAc;AAC/B,QAAA,yBAAyB,EAAE,6BAA6B;KAC3D;AAED,IAAA,IAAM,YAAY,GAAGC,aAAO,CACxB,YAAM,EAAA,OAAA,aAAa,IAAI,aAAa,CAAC,mBAAmB,CAAC,GAAA,EACzD,CAAC,aAAa,CAAC,CAClB;AAED,IAAA,IAAM,UAAU,GAAG,YAAY,IAAI,mBAAmB;AAEtD,IAAA,IAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CAAC;IAExC,QACIC,qCAACC,2BAAmB,CAAC,QAAQ,EAAC,EAAA,KAAK,EAAE,YAAY,EAAA;QAC7CD,sBACI,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAEE,mBAAE,CAACC,uBAAM,CAAC,SAAS,EAAE,SAAS,GAAA,EAAA,GAAA,EAAA;AACrC,gBAAA,EAAA,CAACA,uBAAM,CAAC,MAAM,CAAG,GAAA,YAAY,KAAK,QAAQ;AAC5C,gBAAA,EAAA,EAAA,EAAA,cAAA,EACY,UAAU,EAAA,EAEvB,aAAa,IAAIH,qCAAC,aAAa,EAAA,EAAC,MAAM,EAAE,MAAM,EAAA,CAAI,CACjD,CACqB;AAEvC;;;;"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/components/base-confirmation/component.tsx"],"sourcesContent":["import React, { type ComponentType, type FC, useEffect, useMemo } from 'react';\nimport cn from 'classnames';\n\nimport { usePrevious } from '@alfalab/hooks';\n\nimport { ConfirmationContext } from '../../context';\nimport { type ConfirmationProps, defaultTexts, type TConfirmationContext } from '../../types';\nimport { ONE_DAY, ONE_MINUTE, useCountdown } from '../../utils';\nimport { FatalError, Hint, Initial, TempBlock, TempBlockOver } from '../screens';\n\nimport styles from './index.module.css';\n\nconst confirmationScreens: { [key: string]: ComponentType<{ mobile?: boolean }> } = {\n INITIAL: Initial,\n HINT: Hint,\n FATAL_ERROR: FatalError,\n TEMP_BLOCK: TempBlock,\n TEMP_BLOCK_OVER: TempBlockOver,\n};\n\nexport const BaseConfirmation: FC<ConfirmationProps> = ({\n state,\n screen,\n titleTag = 'h3',\n alignContent = 'left',\n children,\n requiredCharAmount = 5,\n countdownDuration = ONE_MINUTE,\n tempBlockDuration = ONE_DAY,\n phone,\n blockSmsRetry,\n dataTestId,\n className,\n getScreensMap,\n onInputFinished,\n onChangeState,\n onSmsRetryClick,\n onChangeScreen,\n onFatalErrorOkButtonClick,\n onTempBlockFinished,\n mobile,\n clearCodeOnError = true,\n hideCountdownSection = false,\n breakpoint,\n client,\n initialScreenHintSlot,\n errorVisibleDuration,\n ...restProps\n}) => {\n const [timeLeft, startTimer, stopTimer] = useCountdown(countdownDuration);\n\n const prevState = usePrevious(state);\n\n useEffect(() => {\n startTimer();\n }, [startTimer]);\n\n useEffect(() => {\n /**\n * Перезапускаем таймер после повторного запроса кода\n */\n if (state === 'INITIAL' && prevState === 'CODE_SENDING') {\n startTimer();\n }\n }, [state, prevState, startTimer]);\n\n useEffect(() => {\n /**\n * Останавливаем таймер, если новый экран/состояние не содержит таймер\n */\n if (\n !['INITIAL', 'HINT', 'TEMP_BLOCK', 'TEMP_BLOCK_OVER'].includes(screen) ||\n blockSmsRetry\n ) {\n stopTimer();\n }\n }, [state, screen, blockSmsRetry, stopTimer]);\n\n const handleSmsRetry = () => {\n onChangeState('CODE_SENDING');\n\n onSmsRetryClick();\n };\n\n const handleInputFinished = (code: string) => {\n onChangeState('CODE_CHECKING');\n\n onInputFinished(code);\n };\n\n const handleFatalErrorOkButtonClick = () => {\n if (onFatalErrorOkButtonClick) {\n onFatalErrorOkButtonClick();\n }\n };\n\n // eslint-disable-next-line react/jsx-no-constructed-context-values\n const contextValue: TConfirmationContext = {\n hideCountdownSection,\n alignContent,\n titleTag,\n texts: { ...defaultTexts, ...restProps.texts },\n state,\n screen,\n requiredCharAmount,\n countdownDuration,\n timeLeft,\n tempBlockDuration,\n phone,\n blockSmsRetry,\n breakpoint,\n client,\n onTempBlockFinished,\n onChangeState,\n onChangeScreen,\n clearCodeOnError,\n errorVisibleDuration,\n initialScreenHintSlot,\n onInputFinished: handleInputFinished,\n onSmsRetryClick: handleSmsRetry,\n onFatalErrorOkButtonClick: handleFatalErrorOkButtonClick,\n };\n\n const customScreen = useMemo(() => getScreensMap?.(confirmationScreens), [getScreensMap]);\n\n const screensMap = customScreen || confirmationScreens;\n\n const CurrentScreen = screensMap[screen];\n\n return (\n <ConfirmationContext.Provider value={contextValue}>\n <div\n className={cn(styles.component, className, {\n [styles.center]: alignContent === 'center',\n })}\n data-test-id={dataTestId}\n >\n {CurrentScreen && <CurrentScreen mobile={mobile} />}\n </div>\n </ConfirmationContext.Provider>\n );\n};\n"],"names":["Initial","Hint","FatalError","TempBlock","TempBlockOver","ONE_MINUTE","ONE_DAY","__rest","useCountdown","usePrevious","useEffect","defaultTexts","useMemo","React","ConfirmationContext","cn","styles"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAM,mBAAmB,GAA2D;AAChF,IAAA,OAAO,EAAEA,mBAAO;AAChB,IAAA,IAAI,EAAEC,gBAAI;AACV,IAAA,WAAW,EAAEC,sBAAU;AACvB,IAAA,UAAU,EAAEC,qBAAS;AACrB,IAAA,eAAe,EAAEC,uBAAa;CACjC;AAEM,IAAM,gBAAgB,GAA0B,UAAC,EA4BvD,EAAA;;IA3BG,IAAA,KAAK,GAAA,EAAA,CAAA,KAAA,CAAA,CACL,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,EAAe,GAAA,EAAA,CAAA,QAAA,CAAA,CAAf,QAAQ,GAAA,EAAA,KAAA,MAAA,GAAG,IAAI,GAAA,EAAA,EACf,EAAqB,GAAA,EAAA,CAAA,YAAA,CAAA,CAArB,YAAY,GAAA,EAAA,KAAA,MAAA,GAAG,MAAM,GAAA,EAAA,EACb,EAAA,CAAA,QAAA,CACR,KAAA,EAAA,GAAA,EAAA,CAAA,kBAAsB,CAAtB,CAAA,kBAAkB,mB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Q,EAAC,EAAA,KAAK,EAAE,YAAY,EAAA;QAC7CD,sBACI,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAEE,mBAAE,CAACC,uBAAM,CAAC,SAAS,EAAE,SAAS,GAAA,EAAA,GAAA,EAAA;AACrC,gBAAA,EAAA,CAACA,uBAAM,CAAC,MAAM,CAAG,GAAA,YAAY,KAAK,QAAQ;AAC5C,gBAAA,EAAA,EAAA,EAAA,cAAA,EACY,UAAU,EAAA,EAEvB,aAAa,IAAIH,qCAAC,aAAa,EAAA,EAAC,MAAM,EAAE,MAAM,EAAA,CAAI,CACjD,CACqB;AAEvC;;;;"}
@@ -5,7 +5,7 @@
5
5
  } .component {
6
6
  width: 100%;
7
7
  max-width: 388px;
8
- color: var(--color-light-text-secondary)
8
+ color: var(--color-light-text-secondary);
9
9
  } .component.center {
10
10
  margin: var(--gap-0) auto;
11
11
  }
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import { type FC } from 'react';
2
2
  declare type Props = {
3
3
  progress: number;
4
4
  className?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/components/countdown-loader/component.tsx"],"sourcesContent":["import React, { FC } from 'react';\n\nimport styles from './index.module.css';\n\ntype Props = {\n progress: number; // 0-1\n className?: string;\n};\n\nconst SIZE = 16;\nconst STROKE_WIDTH = 2;\n\nconst CENTER = SIZE / 2;\nconst RADIUS = CENTER - STROKE_WIDTH / 2;\n/** Длина окружности */\nconst CIRCUMFERENCE = Math.PI * RADIUS * 2;\n\nexport const CountdownLoader: FC<Props> = ({ progress, className }) => {\n const value = Math.min(progress, 1);\n\n const strokeDasharray = CIRCUMFERENCE.toFixed(2);\n const strokeDashoffset = (value * CIRCUMFERENCE).toFixed(2);\n\n return (\n <svg width={SIZE} height={SIZE} viewBox={`0 0 ${SIZE} ${SIZE}`} className={className}>\n <circle\n cx={CENTER}\n cy={CENTER}\n r={RADIUS}\n strokeDasharray={strokeDasharray}\n strokeDash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":3,"file":"component.js","sources":["../../../src/components/countdown-loader/component.tsx"],"sourcesContent":["import React, { type FC } from 'react';\n\nimport styles from './index.module.css';\n\ntype Props = {\n progress: number; // 0-1\n className?: string;\n};\n\nconst SIZE = 16;\nconst STROKE_WIDTH = 2;\n\nconst CENTER = SIZE / 2;\nconst RADIUS = CENTER - STROKE_WIDTH / 2;\n/** Длина окружности */\nconst CIRCUMFERENCE = Math.PI * RADIUS * 2;\n\nexport const CountdownLoader: FC<Props> = ({ progress, className }) => {\n const value = Math.min(progress, 1);\n\n const strokeDasharray = CIRCUMFERENCE.toFixed(2);\n const strokeDashoffset = (value * CIRCUMFERENCE).toFixed(2);\n\n return (\n <svg width={SIZE} height={SIZE} viewBox={`0 0 ${SIZE} ${SIZE}`} className={className}>\n <circle\n cx={CENTER}\n cy={CENTER}\n r={RADIUS}\n strokeDasharray={strokeDasharray}\n strokeDashoffset={strokeDashoffset}\n transform={`rotate(-90 ${CENTER} ${CENTER})`}\n className={styles.circle}\n />\n </svg>\n );\n};\n"],"names":["React","styles"],"mappings":";;;;;;;;;;;;AASA,IAAM,IAAI,GAAG,EAAE;AACf,IAAM,YAAY,GAAG,CAAC;AAEtB,IAAM,MAAM,GAAG,IAAI,GAAG,CAAC;AACvB,IAAM,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,CAAC;AACxC;AACA,IAAM,aAAa,GAAG,IAAI,CAAC,EAAE,GAAG,MAAM,GAAG,CAAC;AAEnC,IAAM,eAAe,GAAc,UAAC,EAAuB,EAAA;QAArB,QAAQ,GAAA,EAAA,CAAA,QAAA,EAAE,SAAS,GAAA,EAAA,CAAA,SAAA;IAC5D,IAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEnC,IAAM,eAAe,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;AAChD,IAAA,IAAM,gBAAgB,GAAG,CAAC,KAAK,GAAG,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;IAE3D,QACIA,8CAAK,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAA,CAAA,MAAA,CAAO,IAAI,EAAI,GAAA,CAAA,CAAA,MAAA,CAAA,IAAI,CAAE,EAAE,SAAS,EAAE,SAAS,EAAA;AAChF,QAAAA,sBAAA,CAAA,aAAA,CAAA,QAAA,EAAA,EACI,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,CAAC,EAAE,MAAM,EACT,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,aAAA,CAAA,MAAA,CAAc,MAAM,EAAA,GAAA,CAAA,CAAA,MAAA,CAAI,MAAM,EAAG,GAAA,CAAA,EAC5C,SAAS,EAAEC,uBAAM,CAAC,MAAM,EAC1B,CAAA,CACA;AAEd;;;;"}
@@ -1,4 +1,4 @@
1
- import { FC, ReactNode } from 'react';
1
+ import { type FC, type ReactNode } from 'react';
2
2
  export declare type HeaderProps = {
3
3
  /**
4
4
  * Контент шапки
@@ -8,5 +8,10 @@ export declare type HeaderProps = {
8
8
  * Отображать в мобильной версии экран компонента
9
9
  */
10
10
  mobile?: boolean;
11
+ /**
12
+ * HTML тег для заголовка
13
+ * @default 'h3'
14
+ */
15
+ titleTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
11
16
  };
12
17
  export declare const Header: FC<HeaderProps>;