Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import {PasswordInput, PasswordInputProps} from '@gravity-ui/uikit';
import React from 'react';

export const PasswordInputComponent = (props: PasswordInputProps) => {
return (
<div style={{width: '100%', maxWidth: 300, lineHeight: 0}}>
<PasswordInput {...props} />
</div>
);
};
65 changes: 65 additions & 0 deletions src/content/components/uikit/PasswordInput/index.ts
Original file line number Diff line number Diff line change
@@ -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,
},
},
},
};
2 changes: 2 additions & 0 deletions src/content/components/uikit/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -91,6 +92,7 @@ const uikitComponents: Component[] = [
overlayConfig,
paginationConfig,
paletteConfig,
passwordInputConfig,
pinInputConfig,
placeholderContainerConfig,
popoverConfig,
Expand Down
Loading