+ {shouldRenderErrorIcon && (
+
)}
- {success && !error && (
-
+ {shouldRenderSuccessIcon && (
+
= {
title: 'Components/Input',
@@ -47,7 +50,7 @@ export const input: Story = {
)}
value={text('value', '')}
block={boolean('block', false)}
- clear={boolean('clear', false)}
+ clear={select('clear', ['auto', 'always', true, undefined], 'auto')}
size={size}
colors={colors}
disabled={boolean('disabled', false)}
@@ -99,7 +102,7 @@ export const input_mobile: Story = {
)}
value={text('value', '')}
block={boolean('block', false)}
- clear={boolean('clear', false)}
+ clear={select('clear', ['auto', 'always', true, undefined], 'auto')}
size={size}
colors={colors}
disabled={boolean('disabled', false)}
@@ -127,6 +130,26 @@ export const input_desktop: Story = {
const IconComponent = size === 40 ? DiamondsSIcon : StarMIcon;
+ const rightAddons = boolean('rightAddons', false);
+ const multipleRightAddons = rightAddons && boolean('multipleRightAddons', false);
+
+ const renderRightAddons = () => {
+ if (multipleRightAddons) {
+ return (
+ <>
+
+ {size === 40 ? : }
+ >
+ );
+ }
+
+ if (rightAddons) {
+ return ;
+ }
+
+ return undefined;
+ };
+
return (
}
+ rightAddons={renderRightAddons()}
leftAddons={boolean('leftAddons', false) && }
bottomAddons={boolean('bottomAddons', false) && bottom text}
readOnly={boolean('readOnly', false)}
diff --git a/packages/input/src/input-clear.screenshots.test.ts b/packages/input/src/input-clear.screenshots.test.ts
new file mode 100644
index 0000000000..2576f64e00
--- /dev/null
+++ b/packages/input/src/input-clear.screenshots.test.ts
@@ -0,0 +1,1173 @@
+import {
+ setupScreenshotTesting,
+ createStorybookUrl,
+} from '@alfalab/core-components-screenshot-utils';
+import { Page } from 'playwright';
+
+const screenshotTesting = setupScreenshotTesting({
+ it,
+ beforeAll,
+ afterAll,
+ expect,
+});
+
+describe('InputDesktop | auto clear', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '001 default',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ label: 'Фамилия',
+ },
+ }),
+ ],
+ [
+ '005 filled',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ value: 'John Doe',
+ },
+ }),
+ ],
+ [
+ '007 error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ },
+ }),
+ ],
+ [
+ '009 success',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ success: true,
+ value: 'Корректное значение',
+ },
+ }),
+ ],
+ [
+ '011 error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ error: '\u200B',
+ rightAddons: true,
+ value: 'Некорректное значение',
+ label: 'Название инпута',
+ },
+ }),
+ ],
+ [
+ '013 success',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ success: true,
+ value: 'Корректное значение',
+ rightAddons: true,
+ label: 'Название инпута',
+ },
+ }),
+ ],
+ [
+ '015 error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ label: 'Название инпута',
+ rightAddons: true,
+ multipleRightAddons: true,
+ },
+ }),
+ ],
+ [
+ '017 success',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ success: true,
+ value: 'Корректное значение',
+ label: 'Название инпута',
+ rightAddons: true,
+ multipleRightAddons: true,
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ })();
+});
+
+describe('InputDesktop | always clear', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '001 default',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ label: 'Фамилия',
+ },
+ }),
+ ],
+ [
+ '002 filled',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ value: 'John Doe',
+ },
+ }),
+ ],
+ [
+ '003 error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ },
+ }),
+ ],
+ [
+ '004 success',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ success: true,
+ value: 'Корректное значение',
+ },
+ }),
+ ],
+ [
+ '005 error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ error: '\u200B',
+ rightAddons: true,
+ value: 'Некорректное значение',
+ label: 'Название инпута',
+ },
+ }),
+ ],
+ [
+ '006 success',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ success: true,
+ value: 'Корректное значение',
+ rightAddons: true,
+ label: 'Название инпута',
+ },
+ }),
+ ],
+ [
+ '007 error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ label: 'Название инпута',
+ rightAddons: true,
+ multipleRightAddons: true,
+ },
+ }),
+ ],
+ [
+ '008 success',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ success: true,
+ value: 'Корректное значение',
+ label: 'Название инпута',
+ rightAddons: true,
+ multipleRightAddons: true,
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ })();
+});
+
+describe('InputDesktop | auto clear', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '003 start',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ label: 'Фамилия',
+ placeholder: 'Placeholder',
+ },
+ }),
+ ],
+ [
+ '004 filling',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ label: 'Фамилия',
+ value: 'John Doe',
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ evaluate: (page: Page) => page.focus('input').then(() => page.waitForTimeout(500)),
+ })();
+});
+
+describe('InputDesktop | always clear', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '009 start',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ label: 'Фамилия',
+ placeholder: 'Placeholder',
+ },
+ }),
+ ],
+ [
+ '010 filling',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ label: 'Фамилия',
+ value: 'John Doe',
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ evaluate: (page: Page) => page.focus('input').then(() => page.waitForTimeout(500)),
+ })();
+});
+
+describe('InputDesktop | auto clear', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '002 hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ label: 'Фамилия',
+ },
+ }),
+ ],
+ [
+ '006 filled hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ label: 'Фамилия',
+ value: 'John Doe',
+ },
+ }),
+ ],
+ [
+ '008 error hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ },
+ }),
+ ],
+ [
+ '010 success hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ success: true,
+ value: 'Корректное значение',
+ },
+ }),
+ ],
+ [
+ '012 error hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ error: '\u200B',
+ rightAddons: true,
+ value: 'Некорректное значение',
+ label: 'Название инпута',
+ },
+ }),
+ ],
+ [
+ '014 success hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ success: true,
+ value: 'Корректное значение',
+ rightAddons: true,
+ label: 'Название инпута',
+ },
+ }),
+ ],
+ [
+ '016 error hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ label: 'Название инпута',
+ rightAddons: true,
+ multipleRightAddons: true,
+ },
+ }),
+ ],
+ [
+ '018 success hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ success: true,
+ value: 'Корректное значение',
+ label: 'Название инпута',
+ rightAddons: true,
+ multipleRightAddons: true,
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ evaluate: (page: Page) => page.hover('input').then(() => page.waitForTimeout(500)),
+ })();
+});
+
+describe('InputDesktop | always clear', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '011 hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ label: 'Фамилия',
+ },
+ }),
+ ],
+ [
+ '012 filled hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ label: 'Фамилия',
+ value: 'John Doe',
+ },
+ }),
+ ],
+ [
+ '013 error hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ },
+ }),
+ ],
+ [
+ '014 success hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ success: true,
+ value: 'Корректное значение',
+ },
+ }),
+ ],
+ [
+ '015 error hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ error: '\u200B',
+ rightAddons: true,
+ value: 'Некорректное значение',
+ label: 'Название инпута',
+ },
+ }),
+ ],
+ [
+ '016 success hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ success: true,
+ value: 'Корректное значение',
+ rightAddons: true,
+ label: 'Название инпута',
+ },
+ }),
+ ],
+ [
+ '017 error hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ label: 'Название инпута',
+ rightAddons: true,
+ multipleRightAddons: true,
+ },
+ }),
+ ],
+ [
+ '018 success hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ success: true,
+ value: 'Корректное значение',
+ label: 'Название инпута',
+ rightAddons: true,
+ multipleRightAddons: true,
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ evaluate: (page: Page) => page.hover('input').then(() => page.waitForTimeout(500)),
+ })();
+});
+
+// region Desktop site
+describe('InputDesktop | auto clear site theme', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '001 error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ },
+ }),
+ ],
+ [
+ '003 error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ rightAddons: true,
+ label: 'Название инпута',
+ },
+ }),
+ ],
+ [
+ '005 error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ label: 'Название инпута',
+ rightAddons: true,
+ multipleRightAddons: true,
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ theme: 'site',
+ })();
+});
+
+describe('InputDesktop | always clear site theme', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '001 error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ },
+ }),
+ ],
+ [
+ '002 error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ rightAddons: true,
+ label: 'Название инпута',
+ },
+ }),
+ ],
+ [
+ '003 error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ label: 'Название инпута',
+ rightAddons: true,
+ multipleRightAddons: true,
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ theme: 'site',
+ })();
+});
+
+describe('InputDesktop | auto clear site theme', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '002 error hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ },
+ }),
+ ],
+ [
+ '004 error hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ rightAddons: true,
+ label: 'Название инпута',
+ },
+ }),
+ ],
+ [
+ '006 error hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'auto',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ label: 'Название инпута',
+ rightAddons: true,
+ multipleRightAddons: true,
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ theme: 'site',
+ evaluate: (page: Page) => page.hover('input').then(() => page.waitForTimeout(500)),
+ })();
+});
+
+describe('InputDesktop | always clear site theme', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '004 error hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ },
+ }),
+ ],
+ [
+ '005 error hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ rightAddons: true,
+ label: 'Название инпута',
+ },
+ }),
+ ],
+ [
+ '006 error hover',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputDesktop',
+ knobs: {
+ clear: 'always',
+ error: '\u200B',
+ value: 'Некорректное значение',
+ label: 'Название инпута',
+ rightAddons: true,
+ multipleRightAddons: true,
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ theme: 'site',
+ evaluate: (page: Page) => page.hover('input').then(() => page.waitForTimeout(500)),
+ })();
+});
+
+// endregion
+
+// region Mobile
+describe('InputMobile | auto clear', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '001 default',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'auto',
+ label: 'Фамилия',
+ },
+ }),
+ ],
+ [
+ '004 filled',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'auto',
+ value: 'John Doe',
+ },
+ }),
+ ],
+ [
+ '005 filled success',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'auto',
+ value: 'John Doe',
+ success: true,
+ },
+ }),
+ ],
+ [
+ '006 filled error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'auto',
+ value: 'John Doe',
+ error: '\u200B',
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ })();
+});
+
+describe('InputMobile | always clear', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '001 default',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'always',
+ label: 'Фамилия',
+ },
+ }),
+ ],
+ [
+ '002 filled',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'always',
+ value: 'John Doe',
+ },
+ }),
+ ],
+ [
+ '003 filled success',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'always',
+ value: 'John Doe',
+ success: true,
+ },
+ }),
+ ],
+ [
+ '004 filled error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'always',
+ value: 'John Doe',
+ error: '\u200B',
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ })();
+});
+
+describe('InputMobile | auto clear', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '002 start',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'auto',
+ label: 'Фамилия',
+ placeholder: 'Placeholder',
+ },
+ }),
+ ],
+ [
+ '003 filling',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'auto',
+ label: 'Фамилия',
+ value: 'John Doe',
+ },
+ }),
+ ],
+ [
+ '007 filling error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'auto',
+ label: 'Фамилия',
+ value: 'John Doe',
+ error: '\u200B',
+ },
+ }),
+ ],
+ [
+ '008 filling success',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'auto',
+ label: 'Фамилия',
+ value: 'John Doe',
+ success: true,
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ evaluate: (page: Page) => page.focus('input').then(() => page.waitForTimeout(500)),
+ })();
+});
+
+describe('InputMobile | always clear', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '005 start',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'always',
+ label: 'Фамилия',
+ placeholder: 'Placeholder',
+ },
+ }),
+ ],
+ [
+ '006 filling',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'always',
+ label: 'Фамилия',
+ value: 'John Doe',
+ },
+ }),
+ ],
+ [
+ '007 filling error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'always',
+ label: 'Фамилия',
+ value: 'John Doe',
+ error: '\u200B',
+ },
+ }),
+ ],
+ [
+ '008 filling success',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'always',
+ label: 'Фамилия',
+ value: 'John Doe',
+ success: true,
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ evaluate: (page: Page) => page.focus('input').then(() => page.waitForTimeout(500)),
+ })();
+});
+
+describe('InputMobile | auto clear site theme', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '001 filled error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'auto',
+ value: 'John Doe',
+ error: '\u200B',
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ theme: 'site',
+ })();
+});
+
+describe('InputMobile | always clear site theme', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '009 filled error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'always',
+ value: 'John Doe',
+ error: '\u200B',
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ theme: 'site',
+ })();
+});
+
+describe('InputMobile | auto clear site theme', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '002 filling error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'auto',
+ label: 'Фамилия',
+ value: 'John Doe',
+ error: '\u200B',
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ theme: 'site',
+ evaluate: (page: Page) => page.focus('input').then(() => page.waitForTimeout(500)),
+ })();
+});
+
+describe('InputMobile | always clear site theme', () => {
+ screenshotTesting({
+ cases: [
+ [
+ '010 filling error',
+ createStorybookUrl({
+ testStory: false,
+ componentName: 'Input',
+ subComponentName: 'InputMobile',
+ knobs: {
+ clear: 'always',
+ label: 'Фамилия',
+ value: 'John Doe',
+ error: '\u200B',
+ },
+ }),
+ ],
+ ],
+ viewport: { width: 320, height: 80 },
+ screenshotOpts: {
+ fullPage: false,
+ },
+ theme: 'site',
+ evaluate: (page: Page) => page.focus('input').then(() => page.waitForTimeout(500)),
+ })();
+});
+// endregion
diff --git a/packages/number-input/src/Component.test.tsx b/packages/number-input/src/Component.test.tsx
index 9515d65ff6..f9c88a3266 100644
--- a/packages/number-input/src/Component.test.tsx
+++ b/packages/number-input/src/Component.test.tsx
@@ -3,7 +3,7 @@ import { render, fireEvent } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { getNumberInputTestIds } from './utils';
-import { NumberInput, NumberInputProps } from '.';
+import { NumberInputResponsive as NumberInput } from './Component.responsive';
describe('NumberInput', () => {
Object.defineProperty(window, 'matchMedia', {
diff --git a/packages/password-input/src/__image_snapshots__/password-input-desktop-screenshots-addons-default-theme-2-snap.png b/packages/password-input/src/__image_snapshots__/password-input-desktop-screenshots-addons-default-theme-2-snap.png
index e142126e6f..f3bce9da46 100644
--- a/packages/password-input/src/__image_snapshots__/password-input-desktop-screenshots-addons-default-theme-2-snap.png
+++ b/packages/password-input/src/__image_snapshots__/password-input-desktop-screenshots-addons-default-theme-2-snap.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:3cdba0963558a754bbd5c024246666750f9a98471d29fce3767cd3a17cff0048
-size 29481
+oid sha256:04c1683b3f72c7c5bbb9ed023dc8afc1eb58708698cb6cb941bf0548fd6035cf
+size 29493
diff --git a/packages/password-input/src/__image_snapshots__/password-input-desktop-screenshots-addons-site-theme-2-snap.png b/packages/password-input/src/__image_snapshots__/password-input-desktop-screenshots-addons-site-theme-2-snap.png
index df2968ec1e..e7dc82b3fd 100644
--- a/packages/password-input/src/__image_snapshots__/password-input-desktop-screenshots-addons-site-theme-2-snap.png
+++ b/packages/password-input/src/__image_snapshots__/password-input-desktop-screenshots-addons-site-theme-2-snap.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:2e3583dd85e8642a568a8348050c20edb0669eb9c265d4310d5edd00c447ee1f
-size 28369
+oid sha256:c05e1f588d12b79e93298d639285e521a098c8df04ba1fe7a0f1115ba5cedab4
+size 28381
diff --git a/packages/password-input/src/__image_snapshots__/password-input-desktop-screenshots-addons-site-theme-3-snap.png b/packages/password-input/src/__image_snapshots__/password-input-desktop-screenshots-addons-site-theme-3-snap.png
index 07f8f3ab81..f694752596 100644
--- a/packages/password-input/src/__image_snapshots__/password-input-desktop-screenshots-addons-site-theme-3-snap.png
+++ b/packages/password-input/src/__image_snapshots__/password-input-desktop-screenshots-addons-site-theme-3-snap.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:8b26ca3f92fffd9f70a518e2eb018c7ef0079a0d883d4c7a9364f5e917df819f
-size 27301
+oid sha256:3165168a78b3f39843fe6d572691f5e26fcc46958779bc79da1c62473494f9af
+size 27309
diff --git a/packages/password-input/src/__image_snapshots__/password-input-mobile-screenshots-addons-default-theme-2-snap.png b/packages/password-input/src/__image_snapshots__/password-input-mobile-screenshots-addons-default-theme-2-snap.png
index ba9a393ee6..1dfb53cb6a 100644
--- a/packages/password-input/src/__image_snapshots__/password-input-mobile-screenshots-addons-default-theme-2-snap.png
+++ b/packages/password-input/src/__image_snapshots__/password-input-mobile-screenshots-addons-default-theme-2-snap.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:adff3a83a214c07f463c79217b1678a0d4ed6e7a873f81dfef38549bce0a9425
-size 25550
+oid sha256:51025b65eb0e9a6bebe38ddda25a33ae0c691648698d6d9a242233d80d3fe83c
+size 25545
diff --git a/packages/password-input/src/__image_snapshots__/password-input-mobile-screenshots-addons-site-theme-2-snap.png b/packages/password-input/src/__image_snapshots__/password-input-mobile-screenshots-addons-site-theme-2-snap.png
index d472258683..d4a4e75072 100644
--- a/packages/password-input/src/__image_snapshots__/password-input-mobile-screenshots-addons-site-theme-2-snap.png
+++ b/packages/password-input/src/__image_snapshots__/password-input-mobile-screenshots-addons-site-theme-2-snap.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:63b76b8b84421c382c739f982913f2a7ced8c59cf170c8219ee9249b555ff0e1
-size 24709
+oid sha256:1955190d4884d622417c350be5fb953a374c97da6d0a007e6c2628465af1e677
+size 24704
diff --git a/packages/password-input/src/__image_snapshots__/password-input-mobile-screenshots-addons-site-theme-3-snap.png b/packages/password-input/src/__image_snapshots__/password-input-mobile-screenshots-addons-site-theme-3-snap.png
index bb930f8df0..7324a5b599 100644
--- a/packages/password-input/src/__image_snapshots__/password-input-mobile-screenshots-addons-site-theme-3-snap.png
+++ b/packages/password-input/src/__image_snapshots__/password-input-mobile-screenshots-addons-site-theme-3-snap.png
@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
-oid sha256:62f1e22b5753b58798c71ae7b52dfe7541c4e785f766416071647ae3ed56704f
-size 23583
+oid sha256:21f1ad6a8344bcb266f5490a0690f54bcb7a94b70b5f3e4728475f0f0bf0a4b5
+size 23579