From 40af9515c74518e5836be152350930e8ba062da3 Mon Sep 17 00:00:00 2001 From: Loghorrean Date: Tue, 17 Mar 2026 16:28:34 +0300 Subject: [PATCH] Added docs for password input --- .../PasswordInput/PasswordInputComponent.tsx | 10 +++ .../components/uikit/PasswordInput/index.ts | 65 +++++++++++++++++++ src/content/components/uikit/index.ts | 2 + 3 files changed, 77 insertions(+) create mode 100644 src/content/components/uikit/PasswordInput/PasswordInputComponent.tsx create mode 100644 src/content/components/uikit/PasswordInput/index.ts diff --git a/src/content/components/uikit/PasswordInput/PasswordInputComponent.tsx b/src/content/components/uikit/PasswordInput/PasswordInputComponent.tsx new file mode 100644 index 000000000000..27e5bf13c9d6 --- /dev/null +++ b/src/content/components/uikit/PasswordInput/PasswordInputComponent.tsx @@ -0,0 +1,10 @@ +import {PasswordInput, PasswordInputProps} from '@gravity-ui/uikit'; +import React from 'react'; + +export const PasswordInputComponent = (props: PasswordInputProps) => { + return ( +
+ +
+ ); +}; diff --git a/src/content/components/uikit/PasswordInput/index.ts b/src/content/components/uikit/PasswordInput/index.ts new file mode 100644 index 000000000000..dde2b5868150 --- /dev/null +++ b/src/content/components/uikit/PasswordInput/index.ts @@ -0,0 +1,65 @@ +import dynamic from 'next/dynamic'; + +import {Repos} from '../../../../types/common'; +import {getGithubUrl, getReadmeUrl, mappingOptions} from '../../utils'; + +const getterOptions = {repoName: Repos.Uikit, componentName: 'controls/PasswordInput'}; + +export const passwordInputConfig = { + id: 'password-input', + title: 'PasswordInput', + githubUrl: getGithubUrl(getterOptions), + isSupportRTL: true, + content: { + readmeUrl: getReadmeUrl(getterOptions), + }, + sandbox: { + component: dynamic(() => + import('./PasswordInputComponent').then((mod) => mod.PasswordInputComponent), + ), + props: { + view: { + type: 'radioButton', + values: mappingOptions(['normal', 'clear']), + defaultValue: 'normal', + }, + size: { + type: 'radioButton', + values: mappingOptions(['s', 'm', 'l', 'xl']), + defaultValue: 'm', + }, + placeholder: { + type: 'input', + defaultValue: 'Type here...', + }, + label: { + type: 'input', + }, + note: { + type: 'input', + }, + validationState: { + type: 'radioButton', + values: mappingOptions(['normal', 'invalid']), + defaultValue: 'normal', + }, + errorMessage: { + type: 'input', + defaultValue: 'Input is invalid', + }, + errorPlacement: { + type: 'radioButton', + values: mappingOptions(['outside', 'inside']), + defaultValue: 'outside', + }, + disabled: { + type: 'switch', + defaultValue: false, + }, + hasClear: { + type: 'switch', + defaultValue: false, + }, + }, + }, +}; diff --git a/src/content/components/uikit/index.ts b/src/content/components/uikit/index.ts index 702f7b085b67..ac18d9b21532 100644 --- a/src/content/components/uikit/index.ts +++ b/src/content/components/uikit/index.ts @@ -34,6 +34,7 @@ import {numberInputConfig} from './NumberInput'; import {overlayConfig} from './Overlay'; import {paginationConfig} from './Pagination'; import {paletteConfig} from './Palette'; +import {passwordInputConfig} from './PasswordInput'; import {pinInputConfig} from './PinInput'; import {placeholderContainerConfig} from './PlaceholderContainer'; import {popoverConfig} from './Popover'; @@ -91,6 +92,7 @@ const uikitComponents: Component[] = [ overlayConfig, paginationConfig, paletteConfig, + passwordInputConfig, pinInputConfig, placeholderContainerConfig, popoverConfig,