Skip to content

Commit

Permalink
feat: add PinInput docs
Browse files Browse the repository at this point in the history
  • Loading branch information
amje committed Jun 11, 2024
1 parent 35911a1 commit 05fbafa
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 5 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@gravity-ui/date-components": "^2.0.1",
"@gravity-ui/icons": "^2.8.1",
"@gravity-ui/page-constructor": "^5.2.0",
"@gravity-ui/uikit": "^6.15.0",
"@gravity-ui/uikit": "^6.17.0",
"@mdx-js/mdx": "^2.3.0",
"@mdx-js/react": "^2.3.0",
"@testing-library/jest-dom": "^5.16.5",
Expand Down
63 changes: 63 additions & 0 deletions src/content/components/uikit/PinInput/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import dynamic from 'next/dynamic';

import {Repos} from '../../../../types/common';
import {getGithubUrl, getReadmeUrl, mappingOptions} from '../../utils';

const getterOptions = {repoName: Repos.Uikit, componentName: 'PinInput'};

export const pinInputConfig = {
id: 'pin-input',
title: 'PinInput',
githubUrl: getGithubUrl(getterOptions),
isSupportRTL: true,
content: {
readmeUrl: getReadmeUrl(getterOptions),
},
sandbox: {
component: dynamic(() => import('@gravity-ui/uikit').then((mod) => mod.PinInput)),
props: {
size: {
type: 'radioButton',
values: mappingOptions(['s', 'm', 'l', 'xl']),
defaultValue: 'm',
},
type: {
type: 'radioButton',
values: mappingOptions(['numeric', 'alphanumeric']),
defaultValue: 'numeric',
},
length: {
type: 'radioButton',
values: mappingOptions(['4', '6']),
defaultValue: '4',
},
placeholder: {
type: 'input',
},
note: {
type: 'input',
},
validationState: {
type: 'radioButton',
values: mappingOptions(['normal', 'invalid']),
defaultValue: 'normal',
},
errorMessage: {
type: 'input',
defaultValue: 'PIN incorrect',
},
disabled: {
type: 'switch',
defaultValue: false,
},
otp: {
type: 'switch',
defaultValue: false,
},
mask: {
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 @@ -20,6 +20,7 @@ import {menuConfig} from './Menu';
import {modalConfig} from './Modal';
import {paginationConfig} from './Pagination';
import {paletteConfig} from './Palette';
import {pinInputConfig} from './PinInput';
import {popupConfig} from './Popup';
import {portalConfig} from './Portal';
import {progressConfig} from './Progress';
Expand Down Expand Up @@ -62,6 +63,7 @@ const uikitComponents: Component[] = [
modalConfig,
paginationConfig,
paletteConfig,
pinInputConfig,
popupConfig,
portalConfig,
progressConfig,
Expand Down

0 comments on commit 05fbafa

Please sign in to comment.