@cloud-ru/uikit-product-fields-predefined 0.14.1 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +5 -5
  3. package/dist/cjs/components/FieldAi/FieldAi.d.ts +1 -1
  4. package/dist/cjs/components/FieldAi/FieldAi.js +26 -4
  5. package/dist/cjs/components/FieldAi/components/CheckItem/CheckItem.d.ts +2 -1
  6. package/dist/cjs/components/FieldAi/components/CheckItem/CheckItem.js +2 -2
  7. package/dist/cjs/components/FieldAi/components/CheckItem/styles.module.css +14 -0
  8. package/dist/cjs/components/FieldAi/components/PasswordValidation/PasswordValidation.d.ts +3 -2
  9. package/dist/cjs/components/FieldAi/components/PasswordValidation/PasswordValidation.js +2 -2
  10. package/dist/cjs/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.d.ts +3 -2
  11. package/dist/cjs/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.js +3 -3
  12. package/dist/cjs/components/FieldAi/utils.d.ts +1 -0
  13. package/dist/cjs/components/FieldDescription/FieldDescription.d.ts +1 -1
  14. package/dist/cjs/components/FieldDescription/FieldDescriptionRHF.d.ts +1 -1
  15. package/dist/cjs/components/FieldName/FieldName.d.ts +1 -1
  16. package/dist/cjs/components/FieldName/FieldNameRHF.d.ts +1 -1
  17. package/dist/cjs/components/FieldPhone/FieldPhone.d.ts +1 -1
  18. package/dist/esm/components/FieldAi/FieldAi.d.ts +1 -1
  19. package/dist/esm/components/FieldAi/FieldAi.js +27 -5
  20. package/dist/esm/components/FieldAi/components/CheckItem/CheckItem.d.ts +2 -1
  21. package/dist/esm/components/FieldAi/components/CheckItem/CheckItem.js +2 -2
  22. package/dist/esm/components/FieldAi/components/CheckItem/styles.module.css +14 -0
  23. package/dist/esm/components/FieldAi/components/PasswordValidation/PasswordValidation.d.ts +3 -2
  24. package/dist/esm/components/FieldAi/components/PasswordValidation/PasswordValidation.js +2 -2
  25. package/dist/esm/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.d.ts +3 -2
  26. package/dist/esm/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.js +3 -3
  27. package/dist/esm/components/FieldAi/utils.d.ts +1 -0
  28. package/dist/esm/components/FieldDescription/FieldDescription.d.ts +1 -1
  29. package/dist/esm/components/FieldDescription/FieldDescriptionRHF.d.ts +1 -1
  30. package/dist/esm/components/FieldName/FieldName.d.ts +1 -1
  31. package/dist/esm/components/FieldName/FieldNameRHF.d.ts +1 -1
  32. package/dist/esm/components/FieldPhone/FieldPhone.d.ts +1 -1
  33. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  34. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  35. package/package.json +7 -7
  36. package/src/components/FieldAi/FieldAi.tsx +36 -5
  37. package/src/components/FieldAi/components/CheckItem/CheckItem.tsx +3 -2
  38. package/src/components/FieldAi/components/CheckItem/styles.module.scss +16 -0
  39. package/src/components/FieldAi/components/PasswordValidation/PasswordValidation.tsx +9 -2
  40. package/src/components/FieldAi/components/WithPasswordValidation/WithPasswordValidation.tsx +15 -3
  41. package/src/components/FieldAi/utils.ts +2 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,30 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 0.15.1 (2025-12-12)
7
+
8
+ ### Only dependencies have been changed
9
+ * [@cloud-ru/uikit-product-icons@16.1.0](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/icons/CHANGELOG.md)
10
+ * [@cloud-ru/uikit-product-mobile-dropdown@0.9.30](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/mobile-dropdown/CHANGELOG.md)
11
+ * [@cloud-ru/uikit-product-mobile-fields@0.12.2](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/mobile-fields/CHANGELOG.md)
12
+ * [@cloud-ru/uikit-product-mobile-modal@0.9.27](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/mobile-modal/CHANGELOG.md)
13
+ * [@cloud-ru/uikit-product-mobile-tooltip@0.5.3](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/mobile-tooltip/CHANGELOG.md)
14
+
15
+
16
+
17
+
18
+
19
+ # 0.15.0 (2025-12-11)
20
+
21
+
22
+ ### Features
23
+
24
+ * **AINFR-4597:** latin symbols for password and tooltip keys animation ([a3c533f](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/a3c533f05551ad665af52a5e6788a134c6dbb7b5))
25
+
26
+
27
+
28
+
29
+
6
30
  ## 0.14.1 (2025-12-08)
7
31
 
8
32
 
package/README.md CHANGED
@@ -80,7 +80,7 @@
80
80
  | onSubmit* | `(value: string) => void` | - | Колбек действия при отправке |
81
81
  | value | `string` | - | HTML-аттрибут value |
82
82
  | onChange | `(value: string, e?: ChangeEvent<HTMLTextAreaElement>) => void` | - | Колбек смены значения |
83
- | inputMode | enum InputMode: `"none"`, `"text"`, `"tel"`, `"email"`, `"search"`, `"decimal"`, `"numeric"`, `"url"` | - | Режим работы экранной клавиатуры |
83
+ | inputMode | enum InputMode: `"search"`, `"none"`, `"text"`, `"tel"`, `"email"`, `"decimal"`, `"numeric"`, `"url"` | - | Режим работы экранной клавиатуры |
84
84
  | id | `string` | - | HTML-аттрибут id |
85
85
  | name | `string` | - | HTML-аттрибут name |
86
86
  | maxLength | `number` | - | Максимальное кол-во символов |
@@ -106,7 +106,7 @@
106
106
  | resizable | `boolean` | - | Может ли ли пользователь изменять размеры поля (если св-во не включено, поле автоматически меняет свой размер) |
107
107
  | secure | `boolean \| "password"` | - | Режим ввода sensitive данных (пароля, API ключей, токенов, etc) |
108
108
  | onResetContextClick | `() => void` | - | Действие при клике по кнопке сброса контекста |
109
- | ref | `LegacyRef<HTMLTextAreaElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
109
+ | ref | `LegacyRef<HTMLInputElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
110
110
  | key | `Key` | - | |
111
111
  ## FieldChat
112
112
  ### Props
@@ -116,7 +116,7 @@
116
116
  | handleSubmit* | `(value: string) => void` | - | Колбек действия при отправке |
117
117
  | value | `string` | - | HTML-аттрибут value |
118
118
  | onChange | `(value: string, e?: ChangeEvent<HTMLTextAreaElement>) => void` | - | Колбек смены значения |
119
- | inputMode | enum InputMode: `"none"`, `"text"`, `"tel"`, `"email"`, `"search"`, `"decimal"`, `"numeric"`, `"url"` | - | Режим работы экранной клавиатуры |
119
+ | inputMode | enum InputMode: `"search"`, `"none"`, `"text"`, `"tel"`, `"email"`, `"decimal"`, `"numeric"`, `"url"` | - | Режим работы экранной клавиатуры |
120
120
  | id | `string` | - | HTML-аттрибут id |
121
121
  | name | `string` | - | HTML-аттрибут name |
122
122
  | maxLength | `number` | - | Максимальное кол-во символов |
@@ -266,7 +266,7 @@
266
266
  | customSchema | `StringSchema<string, AnyObject, undefined, "">` | - | |
267
267
  | addButton | `boolean` | - | Поле появляется по кнопке "Добавить описание" (только для опционального поля) |
268
268
  | onValidationError | `(error: ValidationError) => void` | - | Колбэк, вызываемый при изменении ошибки валидации (только в standalone режиме) |
269
- | ref | `LegacyRef<HTMLTextAreaElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
269
+ | ref | `LegacyRef<HTMLInputElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
270
270
  | key | `Key` | - | |
271
271
  ## FieldDescriptionRHF
272
272
  Поле описание c оберткой для React Hook Form
@@ -303,7 +303,7 @@
303
303
  | resizable | `boolean` | true | Может ли ли пользователь изменять размеры поля (если св-во не включено, поле автоматически меняет свой размер) |
304
304
  | customSchema | `StringSchema<string, AnyObject, undefined, "">` | - | |
305
305
  | addButton | `boolean` | - | Поле появляется по кнопке "Добавить описание" (только для опционального поля) |
306
- | ref | `LegacyRef<HTMLTextAreaElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
306
+ | ref | `LegacyRef<HTMLInputElement>` | - | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref). @see {@link https://react.dev/learn/referencing-values-with-refs#refs-and-the-dom React Docs} |
307
307
  | key | `Key` | - | |
308
308
 
309
309
 
@@ -16,5 +16,5 @@ export declare const FieldAi: import("react").ForwardRefExoticComponent<Omit<Fie
16
16
  /** Действие при клике по кнопке сброса контекста */
17
17
  onResetContextClick?(): void;
18
18
  } & {
19
- layoutType: import("@cloud-ru/uikit-product-utils").LayoutType;
19
+ layoutType: import("@cloud-ru/uikit-product-utils/.").LayoutType;
20
20
  } & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -37,22 +37,44 @@ exports.FieldAi = (0, react_1.forwardRef)((_a, ref) => {
37
37
  const { t } = (0, uikit_product_locale_1.useLocale)('FieldsPredefined');
38
38
  const isTouchDevice = (0, helpers_1.isTouchDevice)(layoutType);
39
39
  const [isValueHidden, setIsValueHidden] = (0, react_1.useState)(true);
40
+ const [animatedValidationKey, setAnimatedValidationKey] = (0, react_1.useState)(null);
41
+ const timerRef = (0, react_1.useRef)(null);
40
42
  const isValueValid = typeof value === 'string' && value.trim().length > 0;
41
43
  const isPasswordMode = secure === 'password';
42
44
  const passwordValidation = (0, react_1.useMemo)(() => (0, utils_1.getValidationPassword)(value), [value]);
43
45
  const isPasswordValid = isPasswordMode ? Object.values(passwordValidation).every(Boolean) : true;
44
46
  const showPasswordError = !isPasswordValid && secure && value;
47
+ (0, react_1.useEffect)(() => () => {
48
+ if (timerRef.current) {
49
+ clearTimeout(timerRef.current);
50
+ }
51
+ }, []);
45
52
  const handleSubmit = () => {
46
53
  if (isValueValid && isPasswordValid) {
47
54
  handleSubmitProp(value);
48
55
  }
49
56
  };
50
- const handleKeyDown = e => {
57
+ const triggerValidationHighlight = (key) => {
58
+ setAnimatedValidationKey(key);
59
+ timerRef.current = setTimeout(() => {
60
+ setAnimatedValidationKey(null);
61
+ }, 1000);
62
+ };
63
+ const handleKeyDown = event => {
51
64
  if (isTouchDevice) {
52
65
  return;
53
66
  }
54
- if (e.key === 'Enter' && !e.shiftKey) {
55
- e.preventDefault();
67
+ if (isPasswordMode && event.key.length === 1) {
68
+ const isLetter = /\p{L}/u.test(event.key);
69
+ const isLatinLetter = /^[a-zA-Z]$/.test(event.key);
70
+ if (isLetter && !isLatinLetter) {
71
+ event.preventDefault();
72
+ triggerValidationHighlight('onlyLatin');
73
+ return;
74
+ }
75
+ }
76
+ if (event.key === 'Enter' && !event.shiftKey) {
77
+ event.preventDefault();
56
78
  if (!disabled) {
57
79
  handleSubmit();
58
80
  }
@@ -62,5 +84,5 @@ exports.FieldAi = (0, react_1.forwardRef)((_a, ref) => {
62
84
  if (isTouchDevice && !secure) {
63
85
  return ((0, jsx_runtime_1.jsx)(MobileFieldAi_1.MobileFieldAi, Object.assign({}, props, (0, uikit_product_mobile_fields_1.getAdaptiveFieldProps)(props), { onSubmit: handleSubmit, submitEnabled: isValueValid && !disabled, ref: ref, value: value })));
64
86
  }
65
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, className), children: [(0, jsx_runtime_1.jsx)(WithPasswordValidation_1.WithPasswordValidation, { showValidation: isPasswordMode, passwordValidation: passwordValidation, layoutType: layoutType, children: (0, jsx_runtime_1.jsx)(uikit_product_mobile_fields_1.AdaptiveFieldTextArea, Object.assign({}, props, { ref: ref, value: value, size: 'm', minRows: secure ? 1 : 2, maxRows: secure ? 1 : 4, placeholder: secure ? t('FieldAi.secret.placeholder') : t('FieldAi.regular.placeholder'), className: (0, classnames_1.default)(styles_module_scss_1.default.textarea, secure && isValueHidden ? styles_module_scss_1.default.secured : undefined), onKeyDown: handleKeyDown, spellCheck: !secure, validationState: showPasswordError ? 'error' : validationState, footer: (0, jsx_runtime_1.jsx)(TextAreaActionsFooter_1.TextAreaActionsFooter, { left: secure && ((0, jsx_runtime_1.jsx)(button_1.ButtonFunction, { size: 'xs', icon: isValueHidden ? (0, jsx_runtime_1.jsx)(uikit_product_icons_1.EyeSVG, {}) : (0, jsx_runtime_1.jsx)(uikit_product_icons_1.EyeClosedSVG, {}), onClick: () => setIsValueHidden(prev => !prev) })), right: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [secure && onResetContextClick && ((0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { tip: t('FieldAi.resetContext.tooltip'), hoverDelayOpen: 600, children: (0, jsx_runtime_1.jsx)(button_1.ButtonOutline, { size: 'xs', label: t('FieldAi.resetContext.label'), onClick: onResetContextClick, appearance: 'destructive' }) })), (0, jsx_runtime_1.jsx)(FieldSubmitButton_1.FieldSubmitButton, { showTooltip: !isTouchDevice, className: (0, classnames_1.default)(styles_module_scss_1.default.submitButton, isTouchDevice ? styles_module_scss_1.default.mobileSubmitButton : undefined), active: isValueValid && !disabled && isPasswordValid, handleClick: handleSubmit, size: isTouchDevice ? 's' : 'xs' })] }) }) })) }), !isPasswordMode && (0, jsx_runtime_1.jsx)(AIDisclaimer_1.AIDisclaimer, { layoutType: layoutType })] }));
87
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, className), children: [(0, jsx_runtime_1.jsx)(WithPasswordValidation_1.WithPasswordValidation, { showValidation: isPasswordMode, passwordValidation: passwordValidation, layoutType: layoutType, animatedKey: animatedValidationKey, children: (0, jsx_runtime_1.jsx)(uikit_product_mobile_fields_1.AdaptiveFieldTextArea, Object.assign({}, props, { ref: ref, value: value, size: 'm', minRows: secure ? 1 : 2, maxRows: secure ? 1 : 4, placeholder: secure ? t('FieldAi.secret.placeholder') : t('FieldAi.regular.placeholder'), className: (0, classnames_1.default)(styles_module_scss_1.default.textarea, secure && isValueHidden ? styles_module_scss_1.default.secured : undefined), onKeyDown: handleKeyDown, spellCheck: !secure, validationState: showPasswordError ? 'error' : validationState, footer: (0, jsx_runtime_1.jsx)(TextAreaActionsFooter_1.TextAreaActionsFooter, { left: secure && ((0, jsx_runtime_1.jsx)(button_1.ButtonFunction, { size: 'xs', icon: isValueHidden ? (0, jsx_runtime_1.jsx)(uikit_product_icons_1.EyeSVG, {}) : (0, jsx_runtime_1.jsx)(uikit_product_icons_1.EyeClosedSVG, {}), onClick: () => setIsValueHidden(prev => !prev) })), right: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [secure && onResetContextClick && ((0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { tip: t('FieldAi.resetContext.tooltip'), hoverDelayOpen: 600, children: (0, jsx_runtime_1.jsx)(button_1.ButtonOutline, { size: 'xs', label: t('FieldAi.resetContext.label'), onClick: onResetContextClick, appearance: 'destructive' }) })), (0, jsx_runtime_1.jsx)(FieldSubmitButton_1.FieldSubmitButton, { showTooltip: !isTouchDevice, className: (0, classnames_1.default)(styles_module_scss_1.default.submitButton, isTouchDevice ? styles_module_scss_1.default.mobileSubmitButton : undefined), active: isValueValid && !disabled && isPasswordValid, handleClick: handleSubmit, size: isTouchDevice ? 's' : 'xs' })] }) }) })) }), !isPasswordMode && (0, jsx_runtime_1.jsx)(AIDisclaimer_1.AIDisclaimer, { layoutType: layoutType })] }));
66
88
  });
@@ -3,6 +3,7 @@ type CheckItemProps = WithLayoutType<{
3
3
  label: string;
4
4
  checked: boolean;
5
5
  shouldHide?: boolean;
6
+ animated?: boolean;
6
7
  }>;
7
- export declare function CheckItem({ label, checked, layoutType, shouldHide }: CheckItemProps): import("react/jsx-runtime").JSX.Element | null;
8
+ export declare function CheckItem({ label, checked, layoutType, shouldHide, animated }: CheckItemProps): import("react/jsx-runtime").JSX.Element | null;
8
9
  export {};
@@ -10,7 +10,7 @@ const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
10
10
  const typography_1 = require("@snack-uikit/typography");
11
11
  const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
12
12
  const CHECKED_ITEM_DISAPPEAR_TIMEOUT = 500;
13
- function CheckItem({ label, checked, layoutType, shouldHide = false }) {
13
+ function CheckItem({ label, checked, layoutType, shouldHide = false, animated = false }) {
14
14
  const [visible, setVisible] = (0, react_1.useState)(checked);
15
15
  (0, react_1.useEffect)(() => {
16
16
  if (checked) {
@@ -24,5 +24,5 @@ function CheckItem({ label, checked, layoutType, shouldHide = false }) {
24
24
  if (shouldHide && !visible) {
25
25
  return null;
26
26
  }
27
- return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.checkItem, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsx)(uikit_product_icons_1.CheckSVG, { size: 20, className: styles_module_scss_1.default.icon, "data-checked": checked }), (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyM, { className: styles_module_scss_1.default.label, "data-checked": checked, children: label })] }));
27
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.checkItem, "data-layout-type": layoutType, "data-animated": animated, children: [(0, jsx_runtime_1.jsx)(uikit_product_icons_1.CheckSVG, { size: 20, className: styles_module_scss_1.default.icon, "data-checked": checked }), (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyM, { className: styles_module_scss_1.default.label, "data-checked": checked, children: label })] }));
28
28
  }
@@ -1,3 +1,14 @@
1
+ @keyframes shake{
2
+ 0%, 100%{
3
+ transform:translateX(0);
4
+ }
5
+ 10%, 30%, 50%, 70%, 90%{
6
+ transform:translateX(-4px);
7
+ }
8
+ 20%, 40%, 60%, 80%{
9
+ transform:translateX(4px);
10
+ }
11
+ }
1
12
  .checkItem{
2
13
  display:inline-flex;
3
14
  gap:10px;
@@ -5,6 +16,9 @@
5
16
  .checkItem[data-layout-type=mobile], .checkItem[data-layout-type=tablet]{
6
17
  gap:8px;
7
18
  }
19
+ .checkItem[data-animated=true]{
20
+ animation:shake 0.5s ease-in-out;
21
+ }
8
22
 
9
23
  .icon{
10
24
  flex-shrink:0;
@@ -1,6 +1,7 @@
1
1
  import { WithLayoutType } from '@cloud-ru/uikit-product-utils';
2
- import { ValidationPassword } from '../../utils';
2
+ import { ValidationPassword, ValidationPasswordKey } from '../../utils';
3
3
  export type WithPasswordTooltipProps = WithLayoutType<{
4
4
  passwordValidation: ValidationPassword;
5
+ animatedKey?: ValidationPasswordKey | null;
5
6
  }>;
6
- export declare function PasswordValidation({ passwordValidation, layoutType }: WithPasswordTooltipProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function PasswordValidation({ passwordValidation, layoutType, animatedKey }: WithPasswordTooltipProps): import("react/jsx-runtime").JSX.Element;
@@ -10,7 +10,7 @@ const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
10
10
  const helpers_1 = require("../../../../helpers");
11
11
  const CheckItem_1 = require("../CheckItem");
12
12
  const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
13
- function PasswordValidation({ passwordValidation, layoutType }) {
13
+ function PasswordValidation({ passwordValidation, layoutType, animatedKey }) {
14
14
  const { t } = (0, uikit_product_locale_1.useLocale)('FieldsPredefined');
15
15
  const allCriteriaMet = (0, react_1.useMemo)(() => Object.values(passwordValidation).every(item => item), [passwordValidation]);
16
16
  const isTouchDevice = (0, helpers_1.isTouchDevice)(layoutType);
@@ -19,5 +19,5 @@ function PasswordValidation({ passwordValidation, layoutType }) {
19
19
  return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.validationItemsContainer, "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: true, label: t('FieldAi.secret.passwordTooltip.titleSuccess'), layoutType: layoutType, shouldHide: false }) }));
20
20
  }
21
21
  }
22
- return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.validationItemsContainer, "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.validationList, children: [(0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.minLength, label: t('FieldAi.secret.passwordTooltip.minLength'), layoutType: layoutType, shouldHide: isTouchDevice }), (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.onlyLatin, label: t('FieldAi.secret.passwordTooltip.onlyLatin'), layoutType: layoutType, shouldHide: isTouchDevice }), (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.hasLetterCases, label: t('FieldAi.secret.passwordTooltip.hasLetterCases'), layoutType: layoutType, shouldHide: isTouchDevice }), (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.hasNumber, label: t('FieldAi.secret.passwordTooltip.hasNumber'), layoutType: layoutType, shouldHide: isTouchDevice }), (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.hasSymbol, label: t('FieldAi.secret.passwordTooltip.hasSymbol'), layoutType: layoutType, shouldHide: isTouchDevice }), (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.noSpaces, label: t('FieldAi.secret.passwordTooltip.noSpaces'), layoutType: layoutType, shouldHide: isTouchDevice })] }) }));
22
+ return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.validationItemsContainer, "data-layout-type": layoutType, children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.validationList, children: [(0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.minLength, label: t('FieldAi.secret.passwordTooltip.minLength'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'minLength' }), (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.onlyLatin, label: t('FieldAi.secret.passwordTooltip.onlyLatin'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'onlyLatin' }), (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.hasLetterCases, label: t('FieldAi.secret.passwordTooltip.hasLetterCases'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'hasLetterCases' }), (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.hasNumber, label: t('FieldAi.secret.passwordTooltip.hasNumber'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'hasNumber' }), (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.hasSymbol, label: t('FieldAi.secret.passwordTooltip.hasSymbol'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'hasSymbol' }), (0, jsx_runtime_1.jsx)(CheckItem_1.CheckItem, { checked: passwordValidation.noSpaces, label: t('FieldAi.secret.passwordTooltip.noSpaces'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'noSpaces' })] }) }));
23
23
  }
@@ -1,9 +1,10 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { WithLayoutType } from '@cloud-ru/uikit-product-utils';
3
- import { ValidationPassword } from '../../utils';
3
+ import { ValidationPassword, ValidationPasswordKey } from '../../utils';
4
4
  export type WithPasswordTooltipProps = WithLayoutType<{
5
5
  showValidation?: boolean;
6
6
  children: ReactNode;
7
7
  passwordValidation: ValidationPassword;
8
+ animatedKey?: ValidationPasswordKey | null;
8
9
  }>;
9
- export declare function WithPasswordValidation({ showValidation, passwordValidation, layoutType, children, }: WithPasswordTooltipProps): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
10
+ export declare function WithPasswordValidation({ showValidation, passwordValidation, layoutType, children, animatedKey, }: WithPasswordTooltipProps): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
@@ -9,15 +9,15 @@ const uikit_product_mobile_tooltip_1 = require("@cloud-ru/uikit-product-mobile-t
9
9
  const helpers_1 = require("../../../../helpers");
10
10
  const PasswordValidation_1 = require("../PasswordValidation");
11
11
  const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
12
- function WithPasswordValidation({ showValidation, passwordValidation, layoutType, children, }) {
12
+ function WithPasswordValidation({ showValidation, passwordValidation, layoutType, children, animatedKey, }) {
13
13
  if ((0, helpers_1.isTouchDevice)(layoutType)) {
14
14
  if (showValidation) {
15
- return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.validationContainer, children: [(0, jsx_runtime_1.jsx)(PasswordValidation_1.PasswordValidation, { passwordValidation: passwordValidation, layoutType: layoutType }), children] }));
15
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.validationContainer, children: [(0, jsx_runtime_1.jsx)(PasswordValidation_1.PasswordValidation, { passwordValidation: passwordValidation, layoutType: layoutType, animatedKey: animatedKey }), children] }));
16
16
  }
17
17
  return children;
18
18
  }
19
19
  if (showValidation) {
20
- return ((0, jsx_runtime_1.jsx)(uikit_product_mobile_tooltip_1.AdaptiveTooltip, { placement: 'left-end', layoutType: layoutType, tip: (0, jsx_runtime_1.jsx)(PasswordValidation_1.PasswordValidation, { passwordValidation: passwordValidation, layoutType: layoutType }), offset: 8, children: children }));
20
+ return ((0, jsx_runtime_1.jsx)(uikit_product_mobile_tooltip_1.AdaptiveTooltip, { placement: 'left-end', layoutType: layoutType, tip: (0, jsx_runtime_1.jsx)(PasswordValidation_1.PasswordValidation, { passwordValidation: passwordValidation, layoutType: layoutType, animatedKey: animatedKey }), offset: 8, children: children }));
21
21
  }
22
22
  return children;
23
23
  }
@@ -6,4 +6,5 @@ export type ValidationPassword = {
6
6
  hasSymbol: boolean;
7
7
  noSpaces: boolean;
8
8
  };
9
+ export type ValidationPasswordKey = keyof ValidationPassword;
9
10
  export declare const getValidationPassword: (password?: string) => ValidationPassword;
@@ -8,5 +8,5 @@ export declare const FieldDescription: import("react").ForwardRefExoticComponent
8
8
  } & {
9
9
  onValidationError?: (error: ValidationError | null) => void;
10
10
  } & {
11
- layoutType: import("@cloud-ru/uikit-product-utils").LayoutType;
11
+ layoutType: import("@cloud-ru/uikit-product-utils/.").LayoutType;
12
12
  } & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -7,5 +7,5 @@ export declare const FieldDescriptionRHF: import("react").ForwardRefExoticCompon
7
7
  } & {
8
8
  controllerProps: Omit<import("react-hook-form").ControllerProps<import("react-hook-form").FieldValues>, "render" | "rules" | "disabled">;
9
9
  } & {
10
- layoutType: import("@cloud-ru/uikit-product-utils").LayoutType;
10
+ layoutType: import("@cloud-ru/uikit-product-utils/.").LayoutType;
11
11
  } & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -8,5 +8,5 @@ export declare const FieldName: import("react").ForwardRefExoticComponent<Omit<i
8
8
  } & {
9
9
  onValidationError?: (error: ValidationError | null) => void;
10
10
  } & {
11
- layoutType: import("@cloud-ru/uikit-product-utils").LayoutType;
11
+ layoutType: import("@cloud-ru/uikit-product-utils/.").LayoutType;
12
12
  } & import("react").RefAttributes<HTMLInputElement>>;
@@ -7,5 +7,5 @@ export declare const FieldNameRHF: import("react").ForwardRefExoticComponent<Omi
7
7
  } & {
8
8
  controllerProps: Omit<import("react-hook-form").ControllerProps<import("react-hook-form").FieldValues>, "render" | "rules" | "disabled">;
9
9
  } & {
10
- layoutType: import("@cloud-ru/uikit-product-utils").LayoutType;
10
+ layoutType: import("@cloud-ru/uikit-product-utils/.").LayoutType;
11
11
  } & import("react").RefAttributes<HTMLInputElement>>;
@@ -21,5 +21,5 @@ export declare const FieldPhone: import("react").ForwardRefExoticComponent<Omit<
21
21
  /** options — объект конфигурации для изменения стандартного списка стран */
22
22
  options?: CountrySettings;
23
23
  } & {
24
- layoutType: import("@cloud-ru/uikit-product-utils").LayoutType;
24
+ layoutType: import("@cloud-ru/uikit-product-utils/.").LayoutType;
25
25
  } & import("react").RefAttributes<HTMLInputElement>>;
@@ -16,5 +16,5 @@ export declare const FieldAi: import("react").ForwardRefExoticComponent<Omit<Fie
16
16
  /** Действие при клике по кнопке сброса контекста */
17
17
  onResetContextClick?(): void;
18
18
  } & {
19
- layoutType: import("@cloud-ru/uikit-product-utils").LayoutType;
19
+ layoutType: import("@cloud-ru/uikit-product-utils/.").LayoutType;
20
20
  } & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import cn from 'classnames';
14
- import { forwardRef, useMemo, useState } from 'react';
14
+ import { forwardRef, useEffect, useMemo, useRef, useState } from 'react';
15
15
  import { EyeClosedSVG, EyeSVG } from '@cloud-ru/uikit-product-icons';
16
16
  import { useLocale } from '@cloud-ru/uikit-product-locale';
17
17
  import { AdaptiveFieldTextArea, getAdaptiveFieldProps, } from '@cloud-ru/uikit-product-mobile-fields';
@@ -31,22 +31,44 @@ export const FieldAi = forwardRef((_a, ref) => {
31
31
  const { t } = useLocale('FieldsPredefined');
32
32
  const isTouchDevice = isTouchDeviceHelper(layoutType);
33
33
  const [isValueHidden, setIsValueHidden] = useState(true);
34
+ const [animatedValidationKey, setAnimatedValidationKey] = useState(null);
35
+ const timerRef = useRef(null);
34
36
  const isValueValid = typeof value === 'string' && value.trim().length > 0;
35
37
  const isPasswordMode = secure === 'password';
36
38
  const passwordValidation = useMemo(() => getValidationPassword(value), [value]);
37
39
  const isPasswordValid = isPasswordMode ? Object.values(passwordValidation).every(Boolean) : true;
38
40
  const showPasswordError = !isPasswordValid && secure && value;
41
+ useEffect(() => () => {
42
+ if (timerRef.current) {
43
+ clearTimeout(timerRef.current);
44
+ }
45
+ }, []);
39
46
  const handleSubmit = () => {
40
47
  if (isValueValid && isPasswordValid) {
41
48
  handleSubmitProp(value);
42
49
  }
43
50
  };
44
- const handleKeyDown = e => {
51
+ const triggerValidationHighlight = (key) => {
52
+ setAnimatedValidationKey(key);
53
+ timerRef.current = setTimeout(() => {
54
+ setAnimatedValidationKey(null);
55
+ }, 1000);
56
+ };
57
+ const handleKeyDown = event => {
45
58
  if (isTouchDevice) {
46
59
  return;
47
60
  }
48
- if (e.key === 'Enter' && !e.shiftKey) {
49
- e.preventDefault();
61
+ if (isPasswordMode && event.key.length === 1) {
62
+ const isLetter = /\p{L}/u.test(event.key);
63
+ const isLatinLetter = /^[a-zA-Z]$/.test(event.key);
64
+ if (isLetter && !isLatinLetter) {
65
+ event.preventDefault();
66
+ triggerValidationHighlight('onlyLatin');
67
+ return;
68
+ }
69
+ }
70
+ if (event.key === 'Enter' && !event.shiftKey) {
71
+ event.preventDefault();
50
72
  if (!disabled) {
51
73
  handleSubmit();
52
74
  }
@@ -56,5 +78,5 @@ export const FieldAi = forwardRef((_a, ref) => {
56
78
  if (isTouchDevice && !secure) {
57
79
  return (_jsx(MobileFieldAi, Object.assign({}, props, getAdaptiveFieldProps(props), { onSubmit: handleSubmit, submitEnabled: isValueValid && !disabled, ref: ref, value: value })));
58
80
  }
59
- return (_jsxs("div", { className: cn(styles.wrapper, className), children: [_jsx(WithPasswordValidation, { showValidation: isPasswordMode, passwordValidation: passwordValidation, layoutType: layoutType, children: _jsx(AdaptiveFieldTextArea, Object.assign({}, props, { ref: ref, value: value, size: 'm', minRows: secure ? 1 : 2, maxRows: secure ? 1 : 4, placeholder: secure ? t('FieldAi.secret.placeholder') : t('FieldAi.regular.placeholder'), className: cn(styles.textarea, secure && isValueHidden ? styles.secured : undefined), onKeyDown: handleKeyDown, spellCheck: !secure, validationState: showPasswordError ? 'error' : validationState, footer: _jsx(TextAreaActionsFooter, { left: secure && (_jsx(ButtonFunction, { size: 'xs', icon: isValueHidden ? _jsx(EyeSVG, {}) : _jsx(EyeClosedSVG, {}), onClick: () => setIsValueHidden(prev => !prev) })), right: _jsxs(_Fragment, { children: [secure && onResetContextClick && (_jsx(Tooltip, { tip: t('FieldAi.resetContext.tooltip'), hoverDelayOpen: 600, children: _jsx(ButtonOutline, { size: 'xs', label: t('FieldAi.resetContext.label'), onClick: onResetContextClick, appearance: 'destructive' }) })), _jsx(FieldSubmitButton, { showTooltip: !isTouchDevice, className: cn(styles.submitButton, isTouchDevice ? styles.mobileSubmitButton : undefined), active: isValueValid && !disabled && isPasswordValid, handleClick: handleSubmit, size: isTouchDevice ? 's' : 'xs' })] }) }) })) }), !isPasswordMode && _jsx(AIDisclaimer, { layoutType: layoutType })] }));
81
+ return (_jsxs("div", { className: cn(styles.wrapper, className), children: [_jsx(WithPasswordValidation, { showValidation: isPasswordMode, passwordValidation: passwordValidation, layoutType: layoutType, animatedKey: animatedValidationKey, children: _jsx(AdaptiveFieldTextArea, Object.assign({}, props, { ref: ref, value: value, size: 'm', minRows: secure ? 1 : 2, maxRows: secure ? 1 : 4, placeholder: secure ? t('FieldAi.secret.placeholder') : t('FieldAi.regular.placeholder'), className: cn(styles.textarea, secure && isValueHidden ? styles.secured : undefined), onKeyDown: handleKeyDown, spellCheck: !secure, validationState: showPasswordError ? 'error' : validationState, footer: _jsx(TextAreaActionsFooter, { left: secure && (_jsx(ButtonFunction, { size: 'xs', icon: isValueHidden ? _jsx(EyeSVG, {}) : _jsx(EyeClosedSVG, {}), onClick: () => setIsValueHidden(prev => !prev) })), right: _jsxs(_Fragment, { children: [secure && onResetContextClick && (_jsx(Tooltip, { tip: t('FieldAi.resetContext.tooltip'), hoverDelayOpen: 600, children: _jsx(ButtonOutline, { size: 'xs', label: t('FieldAi.resetContext.label'), onClick: onResetContextClick, appearance: 'destructive' }) })), _jsx(FieldSubmitButton, { showTooltip: !isTouchDevice, className: cn(styles.submitButton, isTouchDevice ? styles.mobileSubmitButton : undefined), active: isValueValid && !disabled && isPasswordValid, handleClick: handleSubmit, size: isTouchDevice ? 's' : 'xs' })] }) }) })) }), !isPasswordMode && _jsx(AIDisclaimer, { layoutType: layoutType })] }));
60
82
  });
@@ -3,6 +3,7 @@ type CheckItemProps = WithLayoutType<{
3
3
  label: string;
4
4
  checked: boolean;
5
5
  shouldHide?: boolean;
6
+ animated?: boolean;
6
7
  }>;
7
- export declare function CheckItem({ label, checked, layoutType, shouldHide }: CheckItemProps): import("react/jsx-runtime").JSX.Element | null;
8
+ export declare function CheckItem({ label, checked, layoutType, shouldHide, animated }: CheckItemProps): import("react/jsx-runtime").JSX.Element | null;
8
9
  export {};
@@ -4,7 +4,7 @@ import { CheckSVG } from '@cloud-ru/uikit-product-icons';
4
4
  import { Typography } from '@snack-uikit/typography';
5
5
  import styles from './styles.module.css';
6
6
  const CHECKED_ITEM_DISAPPEAR_TIMEOUT = 500;
7
- export function CheckItem({ label, checked, layoutType, shouldHide = false }) {
7
+ export function CheckItem({ label, checked, layoutType, shouldHide = false, animated = false }) {
8
8
  const [visible, setVisible] = useState(checked);
9
9
  useEffect(() => {
10
10
  if (checked) {
@@ -18,5 +18,5 @@ export function CheckItem({ label, checked, layoutType, shouldHide = false }) {
18
18
  if (shouldHide && !visible) {
19
19
  return null;
20
20
  }
21
- return (_jsxs("div", { className: styles.checkItem, "data-layout-type": layoutType, children: [_jsx(CheckSVG, { size: 20, className: styles.icon, "data-checked": checked }), _jsx(Typography.SansBodyM, { className: styles.label, "data-checked": checked, children: label })] }));
21
+ return (_jsxs("div", { className: styles.checkItem, "data-layout-type": layoutType, "data-animated": animated, children: [_jsx(CheckSVG, { size: 20, className: styles.icon, "data-checked": checked }), _jsx(Typography.SansBodyM, { className: styles.label, "data-checked": checked, children: label })] }));
22
22
  }
@@ -1,3 +1,14 @@
1
+ @keyframes shake{
2
+ 0%, 100%{
3
+ transform:translateX(0);
4
+ }
5
+ 10%, 30%, 50%, 70%, 90%{
6
+ transform:translateX(-4px);
7
+ }
8
+ 20%, 40%, 60%, 80%{
9
+ transform:translateX(4px);
10
+ }
11
+ }
1
12
  .checkItem{
2
13
  display:inline-flex;
3
14
  gap:10px;
@@ -5,6 +16,9 @@
5
16
  .checkItem[data-layout-type=mobile], .checkItem[data-layout-type=tablet]{
6
17
  gap:8px;
7
18
  }
19
+ .checkItem[data-animated=true]{
20
+ animation:shake 0.5s ease-in-out;
21
+ }
8
22
 
9
23
  .icon{
10
24
  flex-shrink:0;
@@ -1,6 +1,7 @@
1
1
  import { WithLayoutType } from '@cloud-ru/uikit-product-utils';
2
- import { ValidationPassword } from '../../utils';
2
+ import { ValidationPassword, ValidationPasswordKey } from '../../utils';
3
3
  export type WithPasswordTooltipProps = WithLayoutType<{
4
4
  passwordValidation: ValidationPassword;
5
+ animatedKey?: ValidationPasswordKey | null;
5
6
  }>;
6
- export declare function PasswordValidation({ passwordValidation, layoutType }: WithPasswordTooltipProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function PasswordValidation({ passwordValidation, layoutType, animatedKey }: WithPasswordTooltipProps): import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,7 @@ import { useLocale } from '@cloud-ru/uikit-product-locale';
4
4
  import { isTouchDevice as isTouchDeviceHelper } from '../../../../helpers';
5
5
  import { CheckItem } from '../CheckItem';
6
6
  import styles from './styles.module.css';
7
- export function PasswordValidation({ passwordValidation, layoutType }) {
7
+ export function PasswordValidation({ passwordValidation, layoutType, animatedKey }) {
8
8
  const { t } = useLocale('FieldsPredefined');
9
9
  const allCriteriaMet = useMemo(() => Object.values(passwordValidation).every(item => item), [passwordValidation]);
10
10
  const isTouchDevice = isTouchDeviceHelper(layoutType);
@@ -13,5 +13,5 @@ export function PasswordValidation({ passwordValidation, layoutType }) {
13
13
  return (_jsx("div", { className: styles.validationItemsContainer, "data-layout-type": layoutType, children: _jsx(CheckItem, { checked: true, label: t('FieldAi.secret.passwordTooltip.titleSuccess'), layoutType: layoutType, shouldHide: false }) }));
14
14
  }
15
15
  }
16
- return (_jsx("div", { className: styles.validationItemsContainer, "data-layout-type": layoutType, children: _jsxs("div", { className: styles.validationList, children: [_jsx(CheckItem, { checked: passwordValidation.minLength, label: t('FieldAi.secret.passwordTooltip.minLength'), layoutType: layoutType, shouldHide: isTouchDevice }), _jsx(CheckItem, { checked: passwordValidation.onlyLatin, label: t('FieldAi.secret.passwordTooltip.onlyLatin'), layoutType: layoutType, shouldHide: isTouchDevice }), _jsx(CheckItem, { checked: passwordValidation.hasLetterCases, label: t('FieldAi.secret.passwordTooltip.hasLetterCases'), layoutType: layoutType, shouldHide: isTouchDevice }), _jsx(CheckItem, { checked: passwordValidation.hasNumber, label: t('FieldAi.secret.passwordTooltip.hasNumber'), layoutType: layoutType, shouldHide: isTouchDevice }), _jsx(CheckItem, { checked: passwordValidation.hasSymbol, label: t('FieldAi.secret.passwordTooltip.hasSymbol'), layoutType: layoutType, shouldHide: isTouchDevice }), _jsx(CheckItem, { checked: passwordValidation.noSpaces, label: t('FieldAi.secret.passwordTooltip.noSpaces'), layoutType: layoutType, shouldHide: isTouchDevice })] }) }));
16
+ return (_jsx("div", { className: styles.validationItemsContainer, "data-layout-type": layoutType, children: _jsxs("div", { className: styles.validationList, children: [_jsx(CheckItem, { checked: passwordValidation.minLength, label: t('FieldAi.secret.passwordTooltip.minLength'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'minLength' }), _jsx(CheckItem, { checked: passwordValidation.onlyLatin, label: t('FieldAi.secret.passwordTooltip.onlyLatin'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'onlyLatin' }), _jsx(CheckItem, { checked: passwordValidation.hasLetterCases, label: t('FieldAi.secret.passwordTooltip.hasLetterCases'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'hasLetterCases' }), _jsx(CheckItem, { checked: passwordValidation.hasNumber, label: t('FieldAi.secret.passwordTooltip.hasNumber'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'hasNumber' }), _jsx(CheckItem, { checked: passwordValidation.hasSymbol, label: t('FieldAi.secret.passwordTooltip.hasSymbol'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'hasSymbol' }), _jsx(CheckItem, { checked: passwordValidation.noSpaces, label: t('FieldAi.secret.passwordTooltip.noSpaces'), layoutType: layoutType, shouldHide: isTouchDevice, animated: animatedKey === 'noSpaces' })] }) }));
17
17
  }
@@ -1,9 +1,10 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { WithLayoutType } from '@cloud-ru/uikit-product-utils';
3
- import { ValidationPassword } from '../../utils';
3
+ import { ValidationPassword, ValidationPasswordKey } from '../../utils';
4
4
  export type WithPasswordTooltipProps = WithLayoutType<{
5
5
  showValidation?: boolean;
6
6
  children: ReactNode;
7
7
  passwordValidation: ValidationPassword;
8
+ animatedKey?: ValidationPasswordKey | null;
8
9
  }>;
9
- export declare function WithPasswordValidation({ showValidation, passwordValidation, layoutType, children, }: WithPasswordTooltipProps): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
10
+ export declare function WithPasswordValidation({ showValidation, passwordValidation, layoutType, children, animatedKey, }: WithPasswordTooltipProps): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
@@ -3,15 +3,15 @@ import { AdaptiveTooltip } from '@cloud-ru/uikit-product-mobile-tooltip';
3
3
  import { isTouchDevice } from '../../../../helpers';
4
4
  import { PasswordValidation } from '../PasswordValidation';
5
5
  import styles from './styles.module.css';
6
- export function WithPasswordValidation({ showValidation, passwordValidation, layoutType, children, }) {
6
+ export function WithPasswordValidation({ showValidation, passwordValidation, layoutType, children, animatedKey, }) {
7
7
  if (isTouchDevice(layoutType)) {
8
8
  if (showValidation) {
9
- return (_jsxs("div", { className: styles.validationContainer, children: [_jsx(PasswordValidation, { passwordValidation: passwordValidation, layoutType: layoutType }), children] }));
9
+ return (_jsxs("div", { className: styles.validationContainer, children: [_jsx(PasswordValidation, { passwordValidation: passwordValidation, layoutType: layoutType, animatedKey: animatedKey }), children] }));
10
10
  }
11
11
  return children;
12
12
  }
13
13
  if (showValidation) {
14
- return (_jsx(AdaptiveTooltip, { placement: 'left-end', layoutType: layoutType, tip: _jsx(PasswordValidation, { passwordValidation: passwordValidation, layoutType: layoutType }), offset: 8, children: children }));
14
+ return (_jsx(AdaptiveTooltip, { placement: 'left-end', layoutType: layoutType, tip: _jsx(PasswordValidation, { passwordValidation: passwordValidation, layoutType: layoutType, animatedKey: animatedKey }), offset: 8, children: children }));
15
15
  }
16
16
  return children;
17
17
  }
@@ -6,4 +6,5 @@ export type ValidationPassword = {
6
6
  hasSymbol: boolean;
7
7
  noSpaces: boolean;
8
8
  };
9
+ export type ValidationPasswordKey = keyof ValidationPassword;
9
10
  export declare const getValidationPassword: (password?: string) => ValidationPassword;
@@ -8,5 +8,5 @@ export declare const FieldDescription: import("react").ForwardRefExoticComponent
8
8
  } & {
9
9
  onValidationError?: (error: ValidationError | null) => void;
10
10
  } & {
11
- layoutType: import("@cloud-ru/uikit-product-utils").LayoutType;
11
+ layoutType: import("@cloud-ru/uikit-product-utils/.").LayoutType;
12
12
  } & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -7,5 +7,5 @@ export declare const FieldDescriptionRHF: import("react").ForwardRefExoticCompon
7
7
  } & {
8
8
  controllerProps: Omit<import("react-hook-form").ControllerProps<import("react-hook-form").FieldValues>, "render" | "rules" | "disabled">;
9
9
  } & {
10
- layoutType: import("@cloud-ru/uikit-product-utils").LayoutType;
10
+ layoutType: import("@cloud-ru/uikit-product-utils/.").LayoutType;
11
11
  } & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -8,5 +8,5 @@ export declare const FieldName: import("react").ForwardRefExoticComponent<Omit<i
8
8
  } & {
9
9
  onValidationError?: (error: ValidationError | null) => void;
10
10
  } & {
11
- layoutType: import("@cloud-ru/uikit-product-utils").LayoutType;
11
+ layoutType: import("@cloud-ru/uikit-product-utils/.").LayoutType;
12
12
  } & import("react").RefAttributes<HTMLInputElement>>;
@@ -7,5 +7,5 @@ export declare const FieldNameRHF: import("react").ForwardRefExoticComponent<Omi
7
7
  } & {
8
8
  controllerProps: Omit<import("react-hook-form").ControllerProps<import("react-hook-form").FieldValues>, "render" | "rules" | "disabled">;
9
9
  } & {
10
- layoutType: import("@cloud-ru/uikit-product-utils").LayoutType;
10
+ layoutType: import("@cloud-ru/uikit-product-utils/.").LayoutType;
11
11
  } & import("react").RefAttributes<HTMLInputElement>>;
@@ -21,5 +21,5 @@ export declare const FieldPhone: import("react").ForwardRefExoticComponent<Omit<
21
21
  /** options — объект конфигурации для изменения стандартного списка стран */
22
22
  options?: CountrySettings;
23
23
  } & {
24
- layoutType: import("@cloud-ru/uikit-product-utils").LayoutType;
24
+ layoutType: import("@cloud-ru/uikit-product-utils/.").LayoutType;
25
25
  } & import("react").RefAttributes<HTMLInputElement>>;