From b60bae5c2c80381e0e898068aea0786b391eacd5 Mon Sep 17 00:00:00 2001 From: Mikhail Shatikhin Date: Fri, 1 Nov 2024 12:33:50 +0500 Subject: [PATCH] fix: react-ui-validations --- .../InlineValidations/ControlsWithValidations.ts | 11 +++++++---- .../InlineValidations/InlineValidations.demo.tsx | 2 +- .../ErrorMessages/TextValidation.demo.tsx | 10 +++------- .../ErrorMessages/TooltipValidation.demo.tsx | 10 +++------- ...lagsExampleValidationsRemoveDivWrapper.demo.tsx | 5 +++-- .../Displaying/FormValidity/FormValidity.demo.tsx | 10 +++------- .../ScrollToValidation/ScrollToValidation.demo.tsx | 5 +++-- .../ValidationLevel/ValidationError.demo.tsx | 10 +++------- .../ValidationLevel/ValidationWarning.demo.tsx | 10 +++------- .../ValidationType/ImmediateValidation.demo.tsx | 5 +++-- .../ValidationType/LostfocusValidation.demo.tsx | 5 +++-- .../ValidationType/SubmitValidation.demo.tsx | 5 +++-- .../Examples/ArrayExample/ArrayExample.demo.tsx | 2 +- .../CustomControls/CustomControls.demo.tsx | 8 ++------ .../docs/Pages/Examples/Editors/Editors.demo.tsx | 2 +- .../Examples/GuidesExample/GuidesExample.demo.tsx | 2 +- .../Pages/Validator/Arrays/ObjectArray.demo.tsx | 2 +- .../Validator/Arrays/PrimitiveTypeArray.demo.tsx | 2 +- .../Independent/LostfocusDependent.demo.tsx | 10 +++------- .../Independent/LostfocusIndependent.demo.tsx | 10 +++------- .../Pages/Validator/Independent/Mixture.demo.tsx | 11 +++-------- .../MissingNodes/MissingObjectNode.demo.tsx | 2 +- .../Validator/MissingNodes/MissingUiNode.demo.tsx | 2 +- .../Pages/Validator/Objects/FlatObject.demo.tsx | 2 +- .../Pages/Validator/Objects/NestedObject.demo.tsx | 2 +- .../Pages/Validator/Objects/PrimitiveType.demo.tsx | 2 +- .../Pages/Validator/Reusable/Reusable.demo.tsx | 11 +++-------- .../react-ui-validations/src/ErrorRenderer.tsx | 5 +++-- .../src/ValidationContainer.tsx | 2 +- .../src/ValidationContextWrapper.tsx | 2 +- .../react-ui-validations/src/ValidationHelper.ts | 4 ++-- .../react-ui-validations/src/ValidationText.tsx | 6 +++--- .../react-ui-validations/src/ValidationWrapper.tsx | 6 +++--- .../src/ValidationWrapperInternal.tsx | 8 +++++--- .../react-ui-validations/src/Validations/Types.ts | 6 +++--- .../src/Validations/ValidationBuilder.ts | 14 +++++++------- .../src/Validations/ValidationReader.ts | 8 ++++---- .../src/Validations/ValidationWriter.ts | 6 +++--- .../src/smoothScrollIntoView.ts | 4 ++-- .../src/utils/createPropsGetter.ts | 2 +- .../featureFlagsContext/FeatureFlagsHelpers.tsx | 3 ++- .../src/utils/getRootNode/getRootNode.ts | 4 ++-- .../stories/Checkbox.stories.tsx | 7 ++++--- .../stories/ComboBox.stories.tsx | 7 ++++--- .../stories/DatePicker.stories.tsx | 7 ++++--- .../stories/FileUploader.stories.tsx | 9 +++++---- .../react-ui-validations/stories/Input.stories.tsx | 9 +++++---- .../stories/ModalWithSingleInput.stories.tsx | 7 ++++--- .../stories/RadioGroup.stories.tsx | 7 ++++--- .../stories/Switcher.stories.tsx | 7 ++++--- .../react-ui-validations/stories/Sync.stories.tsx | 2 +- .../SyncStories/LostfocusDependentValidation.tsx | 5 +++-- .../SyncStories/LostfocusDynamicValidation.tsx | 5 +++-- .../SyncStories/LostfocusIndependentValidation.tsx | 7 ++++--- .../stories/SyncStories/SingleInputPage.tsx | 8 +++++--- .../stories/Themes.stories.tsx | 2 +- .../stories/TokenInput.stories.tsx | 7 ++++--- .../stories/ValidationContainer.stories.tsx | 5 +++-- .../selenium-tests/DependentInputs.stories.tsx | 7 ++++--- .../stories/selenium-tests/Input.stories.tsx | 7 ++++--- .../tests/ErrorRenderer.test.tsx | 5 +++-- .../tests/ValidationContainer.test.tsx | 3 ++- .../tests/ValidationHelper.test.ts | 4 ++-- .../react-ui-validations/tests/Validator.test.ts | 2 +- 64 files changed, 178 insertions(+), 189 deletions(-) diff --git a/packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts b/packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts index 4fdbb7acc82..ed97e9ce1f4 100644 --- a/packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts +++ b/packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/ControlsWithValidations.ts @@ -1,9 +1,12 @@ -import React, { ComponentType } from 'react'; -import { DatePicker, DatePickerProps } from '@skbkontur/react-ui/components/DatePicker'; +import type { ComponentType } from 'react'; +import React from 'react'; +import type { DatePickerProps } from '@skbkontur/react-ui/components/DatePicker'; +import { DatePicker } from '@skbkontur/react-ui/components/DatePicker'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { RenderErrorMessage, ValidationInfo, ValidationWrapper } from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { RenderErrorMessage, ValidationInfo } from '../../../../src'; +import { ValidationWrapper } from '../../../../src'; +import type { Nullable } from '../../../../typings/Types'; type ValidationFunc = (value: Nullable) => Nullable; interface ValidationProps { diff --git a/packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/InlineValidations.demo.tsx b/packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/InlineValidations.demo.tsx index 55257c6930f..f3c1511aef0 100644 --- a/packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/InlineValidations.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Concepts/InlineValidations/InlineValidations.demo.tsx @@ -3,7 +3,7 @@ import { Button } from '@skbkontur/react-ui/components/Button'; import { ValidationContainer } from '../../../../src'; import { Form } from '../../../Common/Form'; -import { Nullable } from '../../../../typings/Types'; +import type { Nullable } from '../../../../typings/Types'; import { Input, DatePicker, lessThanDate } from './ControlsWithValidations'; diff --git a/packages/react-ui-validations/docs/Pages/Displaying/ErrorMessages/TextValidation.demo.tsx b/packages/react-ui-validations/docs/Pages/Displaying/ErrorMessages/TextValidation.demo.tsx index c8a277ba0c9..df740882b4e 100644 --- a/packages/react-ui-validations/docs/Pages/Displaying/ErrorMessages/TextValidation.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Displaying/ErrorMessages/TextValidation.demo.tsx @@ -1,13 +1,9 @@ import React from 'react'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { - ValidationContainer, - ValidationWrapper, - ValidationInfo, - text, -} from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { ValidationInfo } from '../../../../src'; +import { ValidationContainer, ValidationWrapper, text } from '../../../../src'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; export default class TextValidationDemo extends React.Component { diff --git a/packages/react-ui-validations/docs/Pages/Displaying/ErrorMessages/TooltipValidation.demo.tsx b/packages/react-ui-validations/docs/Pages/Displaying/ErrorMessages/TooltipValidation.demo.tsx index bbf0acc93fb..7a70d24d81b 100644 --- a/packages/react-ui-validations/docs/Pages/Displaying/ErrorMessages/TooltipValidation.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Displaying/ErrorMessages/TooltipValidation.demo.tsx @@ -1,13 +1,9 @@ import React from 'react'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { - ValidationContainer, - ValidationWrapper, - ValidationInfo, - tooltip, -} from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { ValidationInfo } from '../../../../src'; +import { ValidationContainer, ValidationWrapper, tooltip } from '../../../../src'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; interface TooltipValidationDemoState { diff --git a/packages/react-ui-validations/docs/Pages/Displaying/FeatureFlags/FeatureFlagsExampleValidationsRemoveDivWrapper.demo.tsx b/packages/react-ui-validations/docs/Pages/Displaying/FeatureFlags/FeatureFlagsExampleValidationsRemoveDivWrapper.demo.tsx index 128df7ef720..384eb6c8f5a 100644 --- a/packages/react-ui-validations/docs/Pages/Displaying/FeatureFlags/FeatureFlagsExampleValidationsRemoveDivWrapper.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Displaying/FeatureFlags/FeatureFlagsExampleValidationsRemoveDivWrapper.demo.tsx @@ -1,8 +1,9 @@ import React from 'react'; import { Button, Checkbox } from '@skbkontur/react-ui'; -import { ValidationContainer, ValidationInfo, ValidationWrapper } from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { ValidationInfo } from '../../../../src'; +import { ValidationContainer, ValidationWrapper } from '../../../../src'; +import type { Nullable } from '../../../../typings/Types'; interface CheckboxState { checked: boolean; diff --git a/packages/react-ui-validations/docs/Pages/Displaying/FormValidity/FormValidity.demo.tsx b/packages/react-ui-validations/docs/Pages/Displaying/FormValidity/FormValidity.demo.tsx index 3cf3ba60282..5a0b52d2610 100644 --- a/packages/react-ui-validations/docs/Pages/Displaying/FormValidity/FormValidity.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Displaying/FormValidity/FormValidity.demo.tsx @@ -3,13 +3,9 @@ import { Button } from '@skbkontur/react-ui/components/Button'; import { Input } from '@skbkontur/react-ui/components/Input'; import { Gapped } from '@skbkontur/react-ui/components/Gapped'; -import { - ValidationBehaviour, - ValidationContainer, - ValidationInfo, - ValidationWrapper, -} from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { ValidationBehaviour, ValidationInfo } from '../../../../src'; +import { ValidationContainer, ValidationWrapper } from '../../../../src'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; interface FormValidityDemoState { diff --git a/packages/react-ui-validations/docs/Pages/Displaying/ScrollToValidation/ScrollToValidation.demo.tsx b/packages/react-ui-validations/docs/Pages/Displaying/ScrollToValidation/ScrollToValidation.demo.tsx index afd79ac2666..40461e6bbd7 100644 --- a/packages/react-ui-validations/docs/Pages/Displaying/ScrollToValidation/ScrollToValidation.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Displaying/ScrollToValidation/ScrollToValidation.demo.tsx @@ -2,10 +2,11 @@ import React from 'react'; import { Button } from '@skbkontur/react-ui/components/Button'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { ValidationContainer, ValidationInfo, ValidationWrapper } from '../../../../src'; +import type { ValidationInfo } from '../../../../src'; +import { ValidationContainer, ValidationWrapper } from '../../../../src'; import { Form } from '../../../Common/Form'; import { SpaceFiller } from '../../../Common/SpaceFiller'; -import { Nullable } from '../../../../typings/Types'; +import type { Nullable } from '../../../../typings/Types'; export default class ScrollToValidationDemo extends React.Component { public state = { diff --git a/packages/react-ui-validations/docs/Pages/Displaying/ValidationLevel/ValidationError.demo.tsx b/packages/react-ui-validations/docs/Pages/Displaying/ValidationLevel/ValidationError.demo.tsx index 72ddfe6ce48..4abe1b97252 100644 --- a/packages/react-ui-validations/docs/Pages/Displaying/ValidationLevel/ValidationError.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Displaying/ValidationLevel/ValidationError.demo.tsx @@ -1,13 +1,9 @@ import React, { useState } from 'react'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { - ValidationContainer, - ValidationWrapper, - ValidationInfo, - text, -} from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { ValidationInfo } from '../../../../src'; +import { ValidationContainer, ValidationWrapper, text } from '../../../../src'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; const validate = (value: string): Nullable => { diff --git a/packages/react-ui-validations/docs/Pages/Displaying/ValidationLevel/ValidationWarning.demo.tsx b/packages/react-ui-validations/docs/Pages/Displaying/ValidationLevel/ValidationWarning.demo.tsx index f1c04555f20..550c6b80533 100644 --- a/packages/react-ui-validations/docs/Pages/Displaying/ValidationLevel/ValidationWarning.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Displaying/ValidationLevel/ValidationWarning.demo.tsx @@ -1,13 +1,9 @@ import React, { useState } from 'react'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { - ValidationContainer, - ValidationWrapper, - ValidationInfo, - text, -} from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { ValidationInfo } from '../../../../src'; +import { ValidationContainer, ValidationWrapper, text } from '../../../../src'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; const validate = (value: string): Nullable => { diff --git a/packages/react-ui-validations/docs/Pages/Displaying/ValidationType/ImmediateValidation.demo.tsx b/packages/react-ui-validations/docs/Pages/Displaying/ValidationType/ImmediateValidation.demo.tsx index ec6f98c4571..86798c200a3 100644 --- a/packages/react-ui-validations/docs/Pages/Displaying/ValidationType/ImmediateValidation.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Displaying/ValidationType/ImmediateValidation.demo.tsx @@ -1,8 +1,9 @@ import React from 'react'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { ValidationContainer, ValidationWrapper, ValidationInfo } from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { ValidationInfo } from '../../../../src'; +import { ValidationContainer, ValidationWrapper } from '../../../../src'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; export default class ImmediateValidationDemo extends React.Component { diff --git a/packages/react-ui-validations/docs/Pages/Displaying/ValidationType/LostfocusValidation.demo.tsx b/packages/react-ui-validations/docs/Pages/Displaying/ValidationType/LostfocusValidation.demo.tsx index 8c1e1f4ee35..40b6625ba05 100644 --- a/packages/react-ui-validations/docs/Pages/Displaying/ValidationType/LostfocusValidation.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Displaying/ValidationType/LostfocusValidation.demo.tsx @@ -1,8 +1,9 @@ import React from 'react'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { ValidationContainer, ValidationWrapper, ValidationInfo } from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { ValidationInfo } from '../../../../src'; +import { ValidationContainer, ValidationWrapper } from '../../../../src'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; interface LostfocusValidationDemoState { diff --git a/packages/react-ui-validations/docs/Pages/Displaying/ValidationType/SubmitValidation.demo.tsx b/packages/react-ui-validations/docs/Pages/Displaying/ValidationType/SubmitValidation.demo.tsx index 19c0a202d30..82bfd42c3cf 100644 --- a/packages/react-ui-validations/docs/Pages/Displaying/ValidationType/SubmitValidation.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Displaying/ValidationType/SubmitValidation.demo.tsx @@ -2,8 +2,9 @@ import React from 'react'; import { Button } from '@skbkontur/react-ui/components/Button'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { ValidationContainer, ValidationWrapper, ValidationInfo } from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { ValidationInfo } from '../../../../src'; +import { ValidationContainer, ValidationWrapper } from '../../../../src'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; export default class SubmitValidationDemo extends React.Component { diff --git a/packages/react-ui-validations/docs/Pages/Examples/ArrayExample/ArrayExample.demo.tsx b/packages/react-ui-validations/docs/Pages/Examples/ArrayExample/ArrayExample.demo.tsx index 0090c0b87de..4f1effec8d5 100644 --- a/packages/react-ui-validations/docs/Pages/Examples/ArrayExample/ArrayExample.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Examples/ArrayExample/ArrayExample.demo.tsx @@ -10,7 +10,7 @@ import { ValidationContainer, ValidationWrapper, } from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; interface ArrayExampleDemoState { diff --git a/packages/react-ui-validations/docs/Pages/Examples/CustomControls/CustomControls.demo.tsx b/packages/react-ui-validations/docs/Pages/Examples/CustomControls/CustomControls.demo.tsx index b56f06ea14e..176e8f25adf 100644 --- a/packages/react-ui-validations/docs/Pages/Examples/CustomControls/CustomControls.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Examples/CustomControls/CustomControls.demo.tsx @@ -1,12 +1,8 @@ import React from 'react'; import { Button, Gapped, Input, Select } from '@skbkontur/react-ui'; -import { - ValidationBehaviour, - ValidationContainer, - ValidationInfo, - ValidationWrapper, -} from '../../../../src'; +import type { ValidationBehaviour, ValidationInfo } from '../../../../src'; +import { ValidationContainer, ValidationWrapper } from '../../../../src'; import { Form } from '../../../Common/Form'; interface CustomControlProps { diff --git a/packages/react-ui-validations/docs/Pages/Examples/Editors/Editors.demo.tsx b/packages/react-ui-validations/docs/Pages/Examples/Editors/Editors.demo.tsx index e1bec714279..15fe6d3b0e9 100644 --- a/packages/react-ui-validations/docs/Pages/Examples/Editors/Editors.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Examples/Editors/Editors.demo.tsx @@ -10,7 +10,7 @@ import { Select } from '@skbkontur/react-ui/components/Select'; import { Textarea } from '@skbkontur/react-ui/components/Textarea'; import { createValidator, ValidationContainer, ValidationWrapper } from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; export interface ContactInfo { diff --git a/packages/react-ui-validations/docs/Pages/Examples/GuidesExample/GuidesExample.demo.tsx b/packages/react-ui-validations/docs/Pages/Examples/GuidesExample/GuidesExample.demo.tsx index 8ec8b211f0d..3d90e14b83e 100644 --- a/packages/react-ui-validations/docs/Pages/Examples/GuidesExample/GuidesExample.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Examples/GuidesExample/GuidesExample.demo.tsx @@ -3,7 +3,7 @@ import { Button } from '@skbkontur/react-ui/components/Button'; import { Input } from '@skbkontur/react-ui/components/Input'; import { ValidationContainer, ValidationWrapper, createValidator } from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; interface Organization { diff --git a/packages/react-ui-validations/docs/Pages/Validator/Arrays/ObjectArray.demo.tsx b/packages/react-ui-validations/docs/Pages/Validator/Arrays/ObjectArray.demo.tsx index f7a0aade4a9..4f021c741a8 100644 --- a/packages/react-ui-validations/docs/Pages/Validator/Arrays/ObjectArray.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Validator/Arrays/ObjectArray.demo.tsx @@ -3,7 +3,7 @@ import { Button } from '@skbkontur/react-ui/components/Button'; import { Input } from '@skbkontur/react-ui/components/Input'; import { createValidator, ValidationContainer, ValidationWrapper } from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; interface ContactInfo { diff --git a/packages/react-ui-validations/docs/Pages/Validator/Arrays/PrimitiveTypeArray.demo.tsx b/packages/react-ui-validations/docs/Pages/Validator/Arrays/PrimitiveTypeArray.demo.tsx index 0adbaf348fb..64d9b7cc63c 100644 --- a/packages/react-ui-validations/docs/Pages/Validator/Arrays/PrimitiveTypeArray.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Validator/Arrays/PrimitiveTypeArray.demo.tsx @@ -3,7 +3,7 @@ import { Button } from '@skbkontur/react-ui/components/Button'; import { Input } from '@skbkontur/react-ui/components/Input'; import { ValidationContainer, ValidationWrapper, createValidator } from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; const validate = createValidator((b) => { diff --git a/packages/react-ui-validations/docs/Pages/Validator/Independent/LostfocusDependent.demo.tsx b/packages/react-ui-validations/docs/Pages/Validator/Independent/LostfocusDependent.demo.tsx index 1fc07fe1549..7ff6687f4ad 100644 --- a/packages/react-ui-validations/docs/Pages/Validator/Independent/LostfocusDependent.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Validator/Independent/LostfocusDependent.demo.tsx @@ -1,13 +1,9 @@ import React from 'react'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { - ValidationContainer, - ValidationWrapper, - ValidationInfo, - text, -} from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { ValidationInfo } from '../../../../src'; +import { ValidationContainer, ValidationWrapper, text } from '../../../../src'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; export default class LostfocusDependentDemo extends React.Component { diff --git a/packages/react-ui-validations/docs/Pages/Validator/Independent/LostfocusIndependent.demo.tsx b/packages/react-ui-validations/docs/Pages/Validator/Independent/LostfocusIndependent.demo.tsx index 21d42b6f9b7..8535c414619 100644 --- a/packages/react-ui-validations/docs/Pages/Validator/Independent/LostfocusIndependent.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Validator/Independent/LostfocusIndependent.demo.tsx @@ -1,13 +1,9 @@ import React from 'react'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { - ValidationContainer, - ValidationWrapper, - ValidationInfo, - text, -} from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { ValidationInfo } from '../../../../src'; +import { ValidationContainer, ValidationWrapper, text } from '../../../../src'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; interface LostfocusDependentErrorValidationDemoState { diff --git a/packages/react-ui-validations/docs/Pages/Validator/Independent/Mixture.demo.tsx b/packages/react-ui-validations/docs/Pages/Validator/Independent/Mixture.demo.tsx index 15ff77ae91a..1cc577843f9 100644 --- a/packages/react-ui-validations/docs/Pages/Validator/Independent/Mixture.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Validator/Independent/Mixture.demo.tsx @@ -1,14 +1,9 @@ import React from 'react'; import { Button, Gapped, Input } from '@skbkontur/react-ui'; -import { Nullable } from '../../../../typings/Types'; -import { - text, - ValidationBehaviour, - ValidationContainer, - ValidationInfo, - ValidationWrapper, -} from '../../../../src'; +import type { Nullable } from '../../../../typings/Types'; +import type { ValidationBehaviour, ValidationInfo } from '../../../../src'; +import { text, ValidationContainer, ValidationWrapper } from '../../../../src'; import { Form } from '../../../Common/Form'; interface IndependentCompareState { diff --git a/packages/react-ui-validations/docs/Pages/Validator/MissingNodes/MissingObjectNode.demo.tsx b/packages/react-ui-validations/docs/Pages/Validator/MissingNodes/MissingObjectNode.demo.tsx index 7701747a38e..66f4b0d7219 100644 --- a/packages/react-ui-validations/docs/Pages/Validator/MissingNodes/MissingObjectNode.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Validator/MissingNodes/MissingObjectNode.demo.tsx @@ -4,7 +4,7 @@ import { Input } from '@skbkontur/react-ui/components/Input'; import { Toggle } from '@skbkontur/react-ui/components/Toggle'; import { ValidationContainer, ValidationWrapper, createValidator } from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; interface ContactInfo { diff --git a/packages/react-ui-validations/docs/Pages/Validator/MissingNodes/MissingUiNode.demo.tsx b/packages/react-ui-validations/docs/Pages/Validator/MissingNodes/MissingUiNode.demo.tsx index 0b218c90baa..f0c54c4bca5 100644 --- a/packages/react-ui-validations/docs/Pages/Validator/MissingNodes/MissingUiNode.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Validator/MissingNodes/MissingUiNode.demo.tsx @@ -4,7 +4,7 @@ import { Input } from '@skbkontur/react-ui/components/Input'; import { Toggle } from '@skbkontur/react-ui/components/Toggle'; import { ValidationContainer, ValidationWrapper, createValidator } from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; interface ContactInfo { diff --git a/packages/react-ui-validations/docs/Pages/Validator/Objects/FlatObject.demo.tsx b/packages/react-ui-validations/docs/Pages/Validator/Objects/FlatObject.demo.tsx index 5b039aae3e7..668584026d8 100644 --- a/packages/react-ui-validations/docs/Pages/Validator/Objects/FlatObject.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Validator/Objects/FlatObject.demo.tsx @@ -3,7 +3,7 @@ import { Button } from '@skbkontur/react-ui/components/Button'; import { Input } from '@skbkontur/react-ui/components/Input'; import { createValidator, ValidationContainer, ValidationWrapper } from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; interface ContactInfo { diff --git a/packages/react-ui-validations/docs/Pages/Validator/Objects/NestedObject.demo.tsx b/packages/react-ui-validations/docs/Pages/Validator/Objects/NestedObject.demo.tsx index 28dc014ce9e..cae89755bcf 100644 --- a/packages/react-ui-validations/docs/Pages/Validator/Objects/NestedObject.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Validator/Objects/NestedObject.demo.tsx @@ -3,7 +3,7 @@ import { Button } from '@skbkontur/react-ui/components/Button'; import { Input } from '@skbkontur/react-ui/components/Input'; import { ValidationContainer, ValidationWrapper, createValidator } from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; interface FullName { diff --git a/packages/react-ui-validations/docs/Pages/Validator/Objects/PrimitiveType.demo.tsx b/packages/react-ui-validations/docs/Pages/Validator/Objects/PrimitiveType.demo.tsx index 5e337c94438..cb05e2df516 100644 --- a/packages/react-ui-validations/docs/Pages/Validator/Objects/PrimitiveType.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Validator/Objects/PrimitiveType.demo.tsx @@ -3,7 +3,7 @@ import { Button } from '@skbkontur/react-ui/components/Button'; import { Input } from '@skbkontur/react-ui/components/Input'; import { ValidationContainer, ValidationWrapper, createValidator } from '../../../../src'; -import { Nullable } from '../../../../typings/Types'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; interface PrimitiveTypeDemoState { diff --git a/packages/react-ui-validations/docs/Pages/Validator/Reusable/Reusable.demo.tsx b/packages/react-ui-validations/docs/Pages/Validator/Reusable/Reusable.demo.tsx index d9465d6d2c8..c938ad5ae6f 100644 --- a/packages/react-ui-validations/docs/Pages/Validator/Reusable/Reusable.demo.tsx +++ b/packages/react-ui-validations/docs/Pages/Validator/Reusable/Reusable.demo.tsx @@ -2,15 +2,10 @@ import React from 'react'; import { Button } from '@skbkontur/react-ui/components/Button'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { Nullable } from '../../../../typings/Types'; +import type { Nullable } from '../../../../typings/Types'; import { Form } from '../../../Common/Form'; -import { - ValidationContainer, - ValidationWrapper, - createValidator, - ValidationBuilder, - ValidationRule, -} from '../../../../src'; +import type { ValidationBuilder, ValidationRule } from '../../../../src'; +import { ValidationContainer, ValidationWrapper, createValidator } from '../../../../src'; interface ReusableDemoState { email: string; diff --git a/packages/react-ui-validations/src/ErrorRenderer.tsx b/packages/react-ui-validations/src/ErrorRenderer.tsx index ed899a57a59..02e4aa89858 100644 --- a/packages/react-ui-validations/src/ErrorRenderer.tsx +++ b/packages/react-ui-validations/src/ErrorRenderer.tsx @@ -1,8 +1,9 @@ import React from 'react'; import { ValidationText } from './ValidationText'; -import { TooltipPosition, ValidationTooltip } from './ValidationTooltip'; -import { RenderErrorMessage, TextPosition } from './ValidationWrapperInternal'; +import type { TooltipPosition } from './ValidationTooltip'; +import { ValidationTooltip } from './ValidationTooltip'; +import type { RenderErrorMessage, TextPosition } from './ValidationWrapperInternal'; export function tooltip(pos: TooltipPosition): RenderErrorMessage { return (control, hasError, validation) => { diff --git a/packages/react-ui-validations/src/ValidationContainer.tsx b/packages/react-ui-validations/src/ValidationContainer.tsx index 8ecf363f48c..6f33aaea878 100644 --- a/packages/react-ui-validations/src/ValidationContainer.tsx +++ b/packages/react-ui-validations/src/ValidationContainer.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { Nullable } from '../typings/Types'; +import type { Nullable } from '../typings/Types'; import { createPropsGetter } from './utils/createPropsGetter'; import { isTestEnv } from './utils/utils'; diff --git a/packages/react-ui-validations/src/ValidationContextWrapper.tsx b/packages/react-ui-validations/src/ValidationContextWrapper.tsx index 18e7c3ea95f..824a3453f20 100644 --- a/packages/react-ui-validations/src/ValidationContextWrapper.tsx +++ b/packages/react-ui-validations/src/ValidationContextWrapper.tsx @@ -1,6 +1,6 @@ import React from 'react'; -import { ValidationWrapperInternal } from './ValidationWrapperInternal'; +import type { ValidationWrapperInternal } from './ValidationWrapperInternal'; import type { ScrollOffset, ValidateArgumentType } from './ValidationContainer'; import { isNullable } from './utils/isNullable'; import { FocusMode } from './FocusMode'; diff --git a/packages/react-ui-validations/src/ValidationHelper.ts b/packages/react-ui-validations/src/ValidationHelper.ts index 8c799b1be3a..cf504fabae1 100644 --- a/packages/react-ui-validations/src/ValidationHelper.ts +++ b/packages/react-ui-validations/src/ValidationHelper.ts @@ -1,6 +1,6 @@ -import { Nullable } from '../typings/Types'; +import type { Nullable } from '../typings/Types'; -import { Validation, ValidationBehaviour, ValidationLevel } from './ValidationWrapperInternal'; +import type { Validation, ValidationBehaviour, ValidationLevel } from './ValidationWrapperInternal'; export function getVisibleValidation( visible: Nullable, diff --git a/packages/react-ui-validations/src/ValidationText.tsx b/packages/react-ui-validations/src/ValidationText.tsx index 3656a284859..3ad7944f4f3 100644 --- a/packages/react-ui-validations/src/ValidationText.tsx +++ b/packages/react-ui-validations/src/ValidationText.tsx @@ -1,9 +1,9 @@ import React, { useContext } from 'react'; -import { Nullable } from '../typings/Types'; -import { ThemeValidations } from '../typings/theme-context'; +import type { Nullable } from '../typings/Types'; +import type { ThemeValidations } from '../typings/theme-context'; -import { TextPosition, Validation } from './ValidationWrapperInternal'; +import type { TextPosition, Validation } from './ValidationWrapperInternal'; import { getValidationTextColor } from './utils/getValidationTextColor'; import { ThemeContext } from './ReactUiDetection'; diff --git a/packages/react-ui-validations/src/ValidationWrapper.tsx b/packages/react-ui-validations/src/ValidationWrapper.tsx index d450abd26d5..446724fa02e 100644 --- a/packages/react-ui-validations/src/ValidationWrapper.tsx +++ b/packages/react-ui-validations/src/ValidationWrapper.tsx @@ -1,16 +1,16 @@ import React from 'react'; -import { Nullable } from '../typings/Types'; +import type { Nullable } from '../typings/Types'; import { tooltip } from './ErrorRenderer'; -import { +import type { RenderErrorMessage, Validation, ValidationBehaviour, ValidationLevel, - ValidationWrapperInternal, ValidationWrapperInternalProps, } from './ValidationWrapperInternal'; +import { ValidationWrapperInternal } from './ValidationWrapperInternal'; export interface ValidationInfo { type?: Nullable; diff --git a/packages/react-ui-validations/src/ValidationWrapperInternal.tsx b/packages/react-ui-validations/src/ValidationWrapperInternal.tsx index 3ee067a1934..32541fb29e6 100644 --- a/packages/react-ui-validations/src/ValidationWrapperInternal.tsx +++ b/packages/react-ui-validations/src/ValidationWrapperInternal.tsx @@ -1,14 +1,16 @@ -import React, { ReactInstance } from 'react'; +import type { ReactInstance } from 'react'; +import React from 'react'; import warning from 'warning'; -import { Nullable } from '../typings/Types'; +import type { Nullable } from '../typings/Types'; import { getRootNode } from './utils/getRootNode'; import { isBrowser } from './utils/utils'; import { smoothScrollIntoView } from './smoothScrollIntoView'; import { getIndependent, getLevel, getType, getVisibleValidation, isEqual } from './ValidationHelper'; import { ReactUiDetection } from './ReactUiDetection'; -import { ValidationContext, ValidationContextType } from './ValidationContextWrapper'; +import type { ValidationContextType } from './ValidationContextWrapper'; +import { ValidationContext } from './ValidationContextWrapper'; if (isBrowser && typeof HTMLElement === 'undefined') { const w = window as any; diff --git a/packages/react-ui-validations/src/Validations/Types.ts b/packages/react-ui-validations/src/Validations/Types.ts index a463ecd4b54..96f45e7627a 100644 --- a/packages/react-ui-validations/src/Validations/Types.ts +++ b/packages/react-ui-validations/src/Validations/Types.ts @@ -1,7 +1,7 @@ -import { Nullable } from '../../typings/Types'; -import { ValidationInfo } from '../ValidationWrapper'; +import type { Nullable } from '../../typings/Types'; +import type { ValidationInfo } from '../ValidationWrapper'; -import { ValidationBuilder } from './ValidationBuilder'; +import type { ValidationBuilder } from './ValidationBuilder'; export interface ValidationNode { validation: Nullable; diff --git a/packages/react-ui-validations/src/Validations/ValidationBuilder.ts b/packages/react-ui-validations/src/Validations/ValidationBuilder.ts index 99ef4d3a304..2e99754ce9c 100644 --- a/packages/react-ui-validations/src/Validations/ValidationBuilder.ts +++ b/packages/react-ui-validations/src/Validations/ValidationBuilder.ts @@ -1,13 +1,13 @@ -import React from 'react'; +import type React from 'react'; -import { Nullable } from '../../typings/Types'; -import { ValidationBehaviour, ValidationLevel } from '../ValidationWrapperInternal'; -import { ValidationInfo } from '../ValidationWrapper'; +import type { Nullable } from '../../typings/Types'; +import type { ValidationBehaviour, ValidationLevel } from '../ValidationWrapperInternal'; +import type { ValidationInfo } from '../ValidationWrapper'; import { isNullable } from '../utils/isNullable'; -import { LambdaPath, PathTokensCache } from './PathHelper'; -import { ValidationWriter } from './ValidationWriter'; -import { ItemValidationRule, ValidationRule } from './Types'; +import type { LambdaPath, PathTokensCache } from './PathHelper'; +import type { ValidationWriter } from './ValidationWriter'; +import type { ItemValidationRule, ValidationRule } from './Types'; interface PathInfo { data: T; diff --git a/packages/react-ui-validations/src/Validations/ValidationReader.ts b/packages/react-ui-validations/src/Validations/ValidationReader.ts index 0d160eccc4f..59cabc028d3 100644 --- a/packages/react-ui-validations/src/Validations/ValidationReader.ts +++ b/packages/react-ui-validations/src/Validations/ValidationReader.ts @@ -1,9 +1,9 @@ /* eslint-disable no-useless-constructor */ -import { ValidationInfo } from '../ValidationWrapper'; -import { ExtractItem, Nullable } from '../../typings/Types'; +import type { ValidationInfo } from '../ValidationWrapper'; +import type { ExtractItem, Nullable } from '../../typings/Types'; -import { ValidationNode } from './Types'; -import { LambdaPath, PathTokensCache } from './PathHelper'; +import type { ValidationNode } from './Types'; +import type { LambdaPath, PathTokensCache } from './PathHelper'; export class ValidationReader { constructor( diff --git a/packages/react-ui-validations/src/Validations/ValidationWriter.ts b/packages/react-ui-validations/src/Validations/ValidationWriter.ts index d5da6a555b7..347748976cf 100644 --- a/packages/react-ui-validations/src/Validations/ValidationWriter.ts +++ b/packages/react-ui-validations/src/Validations/ValidationWriter.ts @@ -1,8 +1,8 @@ -import { ValidationInfo } from '../ValidationWrapper'; +import type { ValidationInfo } from '../ValidationWrapper'; -import { ValidationNode } from './Types'; +import type { ValidationNode } from './Types'; import { ValidationReader } from './ValidationReader'; -import { PathTokensCache } from './PathHelper'; +import type { PathTokensCache } from './PathHelper'; export class ValidationWriter { private readonly node: ValidationNode; diff --git a/packages/react-ui-validations/src/smoothScrollIntoView.ts b/packages/react-ui-validations/src/smoothScrollIntoView.ts index 44b909b9aad..8077279a138 100644 --- a/packages/react-ui-validations/src/smoothScrollIntoView.ts +++ b/packages/react-ui-validations/src/smoothScrollIntoView.ts @@ -1,6 +1,6 @@ -import { Nullable, Omit } from '../typings/Types'; +import type { Nullable, Omit } from '../typings/Types'; -import { ScrollOffset } from './ValidationContainer'; +import type { ScrollOffset } from './ValidationContainer'; import { isBrowser } from './utils/utils'; import { isNullable } from './utils/isNullable'; diff --git a/packages/react-ui-validations/src/utils/createPropsGetter.ts b/packages/react-ui-validations/src/utils/createPropsGetter.ts index 8a8a322e284..3bb69c6b7f0 100644 --- a/packages/react-ui-validations/src/utils/createPropsGetter.ts +++ b/packages/react-ui-validations/src/utils/createPropsGetter.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import type React from 'react'; export type DefaultizedProps = P & DP; diff --git a/packages/react-ui-validations/src/utils/featureFlagsContext/FeatureFlagsHelpers.tsx b/packages/react-ui-validations/src/utils/featureFlagsContext/FeatureFlagsHelpers.tsx index 4e7d6049c9f..5e946792f7e 100644 --- a/packages/react-ui-validations/src/utils/featureFlagsContext/FeatureFlagsHelpers.tsx +++ b/packages/react-ui-validations/src/utils/featureFlagsContext/FeatureFlagsHelpers.tsx @@ -1,4 +1,5 @@ -import { validationsFeatureFlagsDefault, ValidationsFeatureFlags } from './ValidationsFeatureFlagsContext'; +import type { ValidationsFeatureFlags } from './ValidationsFeatureFlagsContext'; +import { validationsFeatureFlagsDefault } from './ValidationsFeatureFlagsContext'; export const getFullValidationsFlagsContext = (flags: ValidationsFeatureFlags) => { return { ...validationsFeatureFlagsDefault, ...flags }; diff --git a/packages/react-ui-validations/src/utils/getRootNode/getRootNode.ts b/packages/react-ui-validations/src/utils/getRootNode/getRootNode.ts index 2d33e7d2a71..bc397d03425 100644 --- a/packages/react-ui-validations/src/utils/getRootNode/getRootNode.ts +++ b/packages/react-ui-validations/src/utils/getRootNode/getRootNode.ts @@ -1,8 +1,8 @@ import { findDOMNode } from 'react-dom'; -import React from 'react'; +import type React from 'react'; import warning from 'warning'; -import { Nullable } from '../../../typings/Types'; +import type { Nullable } from '../../../typings/Types'; import { isElement, isNode, canUseDOM } from '../utils'; interface InstanceWithRootNode { diff --git a/packages/react-ui-validations/stories/Checkbox.stories.tsx b/packages/react-ui-validations/stories/Checkbox.stories.tsx index 42a34078075..ed1c5ef5a45 100644 --- a/packages/react-ui-validations/stories/Checkbox.stories.tsx +++ b/packages/react-ui-validations/stories/Checkbox.stories.tsx @@ -1,10 +1,11 @@ import React, { useRef, useState } from 'react'; -import { Meta } from '@storybook/react'; +import type { Meta } from '@storybook/react'; import { Button } from '@skbkontur/react-ui/components/Button'; import { Checkbox } from '@skbkontur/react-ui/components/Checkbox/Checkbox'; -import { ValidationContainer, ValidationInfo, ValidationWrapper } from '../src'; -import { Nullable } from '../typings/Types'; +import type { ValidationInfo } from '../src'; +import { ValidationContainer, ValidationWrapper } from '../src'; +import type { Nullable } from '../typings/Types'; export default { title: 'Checkbox', diff --git a/packages/react-ui-validations/stories/ComboBox.stories.tsx b/packages/react-ui-validations/stories/ComboBox.stories.tsx index da0a07cf8dd..6baa62d9d5c 100644 --- a/packages/react-ui-validations/stories/ComboBox.stories.tsx +++ b/packages/react-ui-validations/stories/ComboBox.stories.tsx @@ -1,9 +1,10 @@ import React, { useState } from 'react'; -import { Meta } from '@storybook/react'; +import type { Meta } from '@storybook/react'; import { ComboBox } from '@skbkontur/react-ui/components/ComboBox/ComboBox'; -import { ValidationContainer, ValidationInfo, ValidationWrapper } from '../src'; -import { Nullable } from '../typings/Types'; +import type { ValidationInfo } from '../src'; +import { ValidationContainer, ValidationWrapper } from '../src'; +import type { Nullable } from '../typings/Types'; export default { title: 'ComboBox', diff --git a/packages/react-ui-validations/stories/DatePicker.stories.tsx b/packages/react-ui-validations/stories/DatePicker.stories.tsx index 4137549a45e..bf6b42c4a3f 100644 --- a/packages/react-ui-validations/stories/DatePicker.stories.tsx +++ b/packages/react-ui-validations/stories/DatePicker.stories.tsx @@ -1,11 +1,12 @@ import React, { useRef, useState } from 'react'; -import { Meta } from '@storybook/react'; +import type { Meta } from '@storybook/react'; import { Button } from '@skbkontur/react-ui/components/Button'; import { DatePicker } from '@skbkontur/react-ui/components/DatePicker'; import { isNonNullable } from '@skbkontur/react-ui/lib/utils'; -import { ValidationContainer, ValidationInfo, ValidationWrapper } from '../src'; -import { Nullable } from '../typings/Types'; +import type { ValidationInfo } from '../src'; +import { ValidationContainer, ValidationWrapper } from '../src'; +import type { Nullable } from '../typings/Types'; export default { title: 'DatePicker', diff --git a/packages/react-ui-validations/stories/FileUploader.stories.tsx b/packages/react-ui-validations/stories/FileUploader.stories.tsx index 749716106cf..8d0576fa88e 100644 --- a/packages/react-ui-validations/stories/FileUploader.stories.tsx +++ b/packages/react-ui-validations/stories/FileUploader.stories.tsx @@ -1,10 +1,11 @@ import React, { useState } from 'react'; -import { Meta } from '@storybook/react'; +import type { Meta } from '@storybook/react'; import { FileUploader } from '@skbkontur/react-ui/components/FileUploader'; -import { FileUploaderAttachedFile } from '@skbkontur/react-ui/internal/FileUploaderControl/fileUtils'; +import type { FileUploaderAttachedFile } from '@skbkontur/react-ui/internal/FileUploaderControl/fileUtils'; -import { ValidationContainer, ValidationInfo, ValidationWrapper } from '../src'; -import { Nullable } from '../typings/Types'; +import type { ValidationInfo } from '../src'; +import { ValidationContainer, ValidationWrapper } from '../src'; +import type { Nullable } from '../typings/Types'; export default { title: 'FileUploader', diff --git a/packages/react-ui-validations/stories/Input.stories.tsx b/packages/react-ui-validations/stories/Input.stories.tsx index 5b045ecd9d7..78970b45a00 100644 --- a/packages/react-ui-validations/stories/Input.stories.tsx +++ b/packages/react-ui-validations/stories/Input.stories.tsx @@ -1,13 +1,14 @@ import React, { useRef, useState } from 'react'; -import { Meta } from '@storybook/react'; +import type { Meta } from '@storybook/react'; import { Button } from '@skbkontur/react-ui/components/Button'; import { Input } from '@skbkontur/react-ui/components/Input'; import { Select } from '@skbkontur/react-ui/components/Select'; import { Gapped } from '@skbkontur/react-ui'; -import { Story } from '@skbkontur/react-ui/typings/stories'; +import type { Story } from '@skbkontur/react-ui/typings/stories'; -import { text, tooltip, ValidationBehaviour, ValidationContainer, ValidationInfo, ValidationWrapper } from '../src'; -import { Nullable } from '../typings/Types'; +import type { ValidationBehaviour, ValidationInfo } from '../src'; +import { text, tooltip, ValidationContainer, ValidationWrapper } from '../src'; +import type { Nullable } from '../typings/Types'; export default { title: 'Input', diff --git a/packages/react-ui-validations/stories/ModalWithSingleInput.stories.tsx b/packages/react-ui-validations/stories/ModalWithSingleInput.stories.tsx index 93f832e223b..6f6720dc2b0 100644 --- a/packages/react-ui-validations/stories/ModalWithSingleInput.stories.tsx +++ b/packages/react-ui-validations/stories/ModalWithSingleInput.stories.tsx @@ -1,12 +1,13 @@ import React, { useEffect, useRef, useState } from 'react'; -import { Meta } from '@storybook/react'; +import type { Meta } from '@storybook/react'; import { Button } from '@skbkontur/react-ui/components/Button'; import { Center } from '@skbkontur/react-ui/components/Center'; import { Input } from '@skbkontur/react-ui/components/Input'; import { Modal } from '@skbkontur/react-ui/components/Modal'; -import { text, ValidationContainer, ValidationInfo, ValidationWrapper } from '../src'; -import { Nullable } from '../typings/Types'; +import type { ValidationInfo } from '../src'; +import { text, ValidationContainer, ValidationWrapper } from '../src'; +import type { Nullable } from '../typings/Types'; export default { title: 'ModalWithSingleInput', diff --git a/packages/react-ui-validations/stories/RadioGroup.stories.tsx b/packages/react-ui-validations/stories/RadioGroup.stories.tsx index 8e8633571d0..3ed2cab6712 100644 --- a/packages/react-ui-validations/stories/RadioGroup.stories.tsx +++ b/packages/react-ui-validations/stories/RadioGroup.stories.tsx @@ -1,11 +1,12 @@ import React, { useRef, useState } from 'react'; -import { Meta } from '@storybook/react'; +import type { Meta } from '@storybook/react'; import { Button } from '@skbkontur/react-ui/components/Button'; import { RadioGroup } from '@skbkontur/react-ui/components/RadioGroup'; import { Radio } from '@skbkontur/react-ui/components/Radio'; -import { ValidationContainer, ValidationInfo, ValidationWrapper } from '../src'; -import { Nullable } from '../typings/Types'; +import type { ValidationInfo } from '../src'; +import { ValidationContainer, ValidationWrapper } from '../src'; +import type { Nullable } from '../typings/Types'; import { isNullable } from '../src/utils/isNullable'; export default { diff --git a/packages/react-ui-validations/stories/Switcher.stories.tsx b/packages/react-ui-validations/stories/Switcher.stories.tsx index 522e3b05dcd..7ac62ed3b0d 100644 --- a/packages/react-ui-validations/stories/Switcher.stories.tsx +++ b/packages/react-ui-validations/stories/Switcher.stories.tsx @@ -1,10 +1,11 @@ import React, { useRef, useState } from 'react'; -import { Meta } from '@storybook/react'; +import type { Meta } from '@storybook/react'; import { Button } from '@skbkontur/react-ui/components/Button'; import { Switcher } from '@skbkontur/react-ui/components/Switcher/Switcher'; -import { ValidationContainer, ValidationInfo, ValidationWrapper } from '../src'; -import { Nullable } from '../typings/Types'; +import type { ValidationInfo } from '../src'; +import { ValidationContainer, ValidationWrapper } from '../src'; +import type { Nullable } from '../typings/Types'; export default { title: 'Switcher', diff --git a/packages/react-ui-validations/stories/Sync.stories.tsx b/packages/react-ui-validations/stories/Sync.stories.tsx index bf2fee5df33..33adb713b94 100644 --- a/packages/react-ui-validations/stories/Sync.stories.tsx +++ b/packages/react-ui-validations/stories/Sync.stories.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Meta } from '@storybook/react'; +import type { Meta } from '@storybook/react'; import { LostfocusDependentValidation as LostfocusDependentValidationStory } from './SyncStories/LostfocusDependentValidation'; import { LostfocusDynamicValidation as LostfocusDynamicValidationStory } from './SyncStories/LostfocusDynamicValidation'; diff --git a/packages/react-ui-validations/stories/SyncStories/LostfocusDependentValidation.tsx b/packages/react-ui-validations/stories/SyncStories/LostfocusDependentValidation.tsx index 59f2350e8fe..a3f72cc5d6f 100644 --- a/packages/react-ui-validations/stories/SyncStories/LostfocusDependentValidation.tsx +++ b/packages/react-ui-validations/stories/SyncStories/LostfocusDependentValidation.tsx @@ -3,8 +3,9 @@ import { Button } from '@skbkontur/react-ui/components/Button'; import { Gapped } from '@skbkontur/react-ui/components/Gapped'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { text, ValidationContainer, ValidationInfo, ValidationWrapper } from '../../src'; -import { Nullable } from '../../typings/Types'; +import type { ValidationInfo } from '../../src'; +import { text, ValidationContainer, ValidationWrapper } from '../../src'; +import type { Nullable } from '../../typings/Types'; export const LostfocusDependentValidation = () => { const refContainer = useRef(null); diff --git a/packages/react-ui-validations/stories/SyncStories/LostfocusDynamicValidation.tsx b/packages/react-ui-validations/stories/SyncStories/LostfocusDynamicValidation.tsx index bc32b555541..605f85d23cf 100644 --- a/packages/react-ui-validations/stories/SyncStories/LostfocusDynamicValidation.tsx +++ b/packages/react-ui-validations/stories/SyncStories/LostfocusDynamicValidation.tsx @@ -2,8 +2,9 @@ import React, { useRef, useState } from 'react'; import { Gapped } from '@skbkontur/react-ui/components/Gapped'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { text, ValidationContainer, ValidationInfo, ValidationWrapper } from '../../src'; -import { Nullable } from '../../typings/Types'; +import type { ValidationInfo } from '../../src'; +import { text, ValidationContainer, ValidationWrapper } from '../../src'; +import type { Nullable } from '../../typings/Types'; export const LostfocusDynamicValidation = () => { const counter = useRef(0); diff --git a/packages/react-ui-validations/stories/SyncStories/LostfocusIndependentValidation.tsx b/packages/react-ui-validations/stories/SyncStories/LostfocusIndependentValidation.tsx index bce515356d2..3e658408039 100644 --- a/packages/react-ui-validations/stories/SyncStories/LostfocusIndependentValidation.tsx +++ b/packages/react-ui-validations/stories/SyncStories/LostfocusIndependentValidation.tsx @@ -3,10 +3,11 @@ import { Button } from '@skbkontur/react-ui/components/Button'; import { Gapped } from '@skbkontur/react-ui/components/Gapped'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { createValidator, ValidationContainer, ValidationInfo, ValidationWrapper } from '../../src'; -import { Nullable } from '../../typings/Types'; +import type { ValidationInfo } from '../../src'; +import { createValidator, ValidationContainer, ValidationWrapper } from '../../src'; +import type { Nullable } from '../../typings/Types'; -import { ValidationState } from './ValidationHelper'; +import type { ValidationState } from './ValidationHelper'; interface ObjectType { value3: string; diff --git a/packages/react-ui-validations/stories/SyncStories/SingleInputPage.tsx b/packages/react-ui-validations/stories/SyncStories/SingleInputPage.tsx index b86304c914a..725f4e284ac 100644 --- a/packages/react-ui-validations/stories/SyncStories/SingleInputPage.tsx +++ b/packages/react-ui-validations/stories/SyncStories/SingleInputPage.tsx @@ -1,8 +1,10 @@ -import React, { FC, useRef, useState } from 'react'; +import type { FC } from 'react'; +import React, { useRef, useState } from 'react'; import { Button, Gapped, Input, Select } from '@skbkontur/react-ui'; -import { text, ValidationContainer, ValidationInfo, ValidationWrapper } from '../../src'; -import { Nullable } from '../../typings/Types'; +import type { ValidationInfo } from '../../src'; +import { text, ValidationContainer, ValidationWrapper } from '../../src'; +import type { Nullable } from '../../typings/Types'; interface SingleInputPageProps { initialValue?: string; diff --git a/packages/react-ui-validations/stories/Themes.stories.tsx b/packages/react-ui-validations/stories/Themes.stories.tsx index a21824fd7f7..5d1c90931c7 100644 --- a/packages/react-ui-validations/stories/Themes.stories.tsx +++ b/packages/react-ui-validations/stories/Themes.stories.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Meta } from '@storybook/react'; +import type { Meta } from '@storybook/react'; import { DARK_THEME, Gapped, Input, ThemeContext, ThemeFactory } from '@skbkontur/react-ui'; import { text, ValidationContainer, ValidationWrapper } from '../src'; diff --git a/packages/react-ui-validations/stories/TokenInput.stories.tsx b/packages/react-ui-validations/stories/TokenInput.stories.tsx index f22b3c15fa5..1167c23cd7b 100644 --- a/packages/react-ui-validations/stories/TokenInput.stories.tsx +++ b/packages/react-ui-validations/stories/TokenInput.stories.tsx @@ -1,10 +1,11 @@ import React, { useRef, useState } from 'react'; -import { Meta } from '@storybook/react'; +import type { Meta } from '@storybook/react'; import { Token } from '@skbkontur/react-ui/components/Token'; import { TokenInput } from '@skbkontur/react-ui/components/TokenInput'; -import { ValidationContainer, ValidationInfo, ValidationWrapper, tooltip } from '../src'; -import { Nullable } from '../typings/Types'; +import type { ValidationInfo } from '../src'; +import { ValidationContainer, ValidationWrapper, tooltip } from '../src'; +import type { Nullable } from '../typings/Types'; export default { title: 'TokenInput', diff --git a/packages/react-ui-validations/stories/ValidationContainer.stories.tsx b/packages/react-ui-validations/stories/ValidationContainer.stories.tsx index d089126255a..80ed61771f3 100644 --- a/packages/react-ui-validations/stories/ValidationContainer.stories.tsx +++ b/packages/react-ui-validations/stories/ValidationContainer.stories.tsx @@ -1,8 +1,9 @@ import React from 'react'; -import { Meta } from '@storybook/react'; +import type { Meta } from '@storybook/react'; import { Button, Gapped, Input } from '@skbkontur/react-ui'; -import { text, ValidationContainer, ValidationInfo, ValidationWrapper } from '../src'; +import type { ValidationInfo } from '../src'; +import { text, ValidationContainer, ValidationWrapper } from '../src'; export default { title: 'ValidationContainer', diff --git a/packages/react-ui-validations/stories/selenium-tests/DependentInputs.stories.tsx b/packages/react-ui-validations/stories/selenium-tests/DependentInputs.stories.tsx index 38ffc8702fc..03900cbb993 100644 --- a/packages/react-ui-validations/stories/selenium-tests/DependentInputs.stories.tsx +++ b/packages/react-ui-validations/stories/selenium-tests/DependentInputs.stories.tsx @@ -1,9 +1,10 @@ import React, { useState } from 'react'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { Meta } from '@storybook/react'; +import type { Meta } from '@storybook/react'; -import { text, ValidationContainer, ValidationInfo, ValidationWrapper } from '../../src'; -import { Nullable } from '../../typings/Types'; +import type { ValidationInfo} from '../../src'; +import { text, ValidationContainer, ValidationWrapper } from '../../src'; +import type { Nullable } from '../../typings/Types'; export default { title: 'DependentInputs', diff --git a/packages/react-ui-validations/stories/selenium-tests/Input.stories.tsx b/packages/react-ui-validations/stories/selenium-tests/Input.stories.tsx index 7c1aa83f4fc..fc61040f05e 100644 --- a/packages/react-ui-validations/stories/selenium-tests/Input.stories.tsx +++ b/packages/react-ui-validations/stories/selenium-tests/Input.stories.tsx @@ -1,9 +1,10 @@ import React, { useState } from 'react'; -import { Meta } from '@storybook/react'; +import type { Meta } from '@storybook/react'; import { Input } from '@skbkontur/react-ui/components/Input'; -import { text, ValidationContainer, ValidationInfo, ValidationWrapper } from '../../src'; -import { Nullable } from '../../typings/Types'; +import type { ValidationInfo} from '../../src'; +import { text, ValidationContainer, ValidationWrapper } from '../../src'; +import type { Nullable } from '../../typings/Types'; export default { title: 'SingleInput', diff --git a/packages/react-ui-validations/tests/ErrorRenderer.test.tsx b/packages/react-ui-validations/tests/ErrorRenderer.test.tsx index bfa6b5acac2..323ce048f06 100644 --- a/packages/react-ui-validations/tests/ErrorRenderer.test.tsx +++ b/packages/react-ui-validations/tests/ErrorRenderer.test.tsx @@ -4,8 +4,9 @@ import { render, screen } from '@testing-library/react'; import { Input } from '@skbkontur/react-ui'; import { tooltip, text } from '../src/ErrorRenderer'; -import { ValidationInfo, ValidationWrapper } from '../src/ValidationWrapper'; -import { Nullable } from '../typings/Types'; +import type { ValidationInfo } from '../src/ValidationWrapper'; +import { ValidationWrapper } from '../src/ValidationWrapper'; +import type { Nullable } from '../typings/Types'; const validate = (): Nullable => { return { message: 'Только цифры', type: 'immediate' }; diff --git a/packages/react-ui-validations/tests/ValidationContainer.test.tsx b/packages/react-ui-validations/tests/ValidationContainer.test.tsx index 68704960577..17d2c973197 100644 --- a/packages/react-ui-validations/tests/ValidationContainer.test.tsx +++ b/packages/react-ui-validations/tests/ValidationContainer.test.tsx @@ -12,7 +12,8 @@ import { TokenInputType, } from '@skbkontur/react-ui'; -import { FocusMode, ValidationContainer, ValidationInfo, ValidationContainerProps, ValidationWrapper } from '../src'; +import type { ValidationInfo, ValidationContainerProps } from '../src'; +import { FocusMode, ValidationContainer, ValidationWrapper } from '../src'; import { smoothScrollIntoView } from '../src/smoothScrollIntoView'; describe('ValidationContainer', () => { diff --git a/packages/react-ui-validations/tests/ValidationHelper.test.ts b/packages/react-ui-validations/tests/ValidationHelper.test.ts index 7daf30405ee..8899e373828 100644 --- a/packages/react-ui-validations/tests/ValidationHelper.test.ts +++ b/packages/react-ui-validations/tests/ValidationHelper.test.ts @@ -1,5 +1,5 @@ -import { Nullable } from '../typings/Types'; -import { Validation, ValidationBehaviour } from '../src'; +import type { Nullable } from '../typings/Types'; +import type { Validation, ValidationBehaviour } from '../src'; import { getVisibleValidation } from '../src/ValidationHelper'; describe('ValidationHelper', () => { diff --git a/packages/react-ui-validations/tests/Validator.test.ts b/packages/react-ui-validations/tests/Validator.test.ts index 635c29db4fc..d173807b97e 100644 --- a/packages/react-ui-validations/tests/Validator.test.ts +++ b/packages/react-ui-validations/tests/Validator.test.ts @@ -1,5 +1,5 @@ import { createValidator } from '../src/Validations'; -import { Nullable } from '../typings/Types'; +import type { Nullable } from '../typings/Types'; describe('Validator', () => { it('root invalid', () => {