Skip to content

Commit 446f3c2

Browse files
authored
feat(Hotkey): add hotkey docs (#513)
1 parent 3f91b69 commit 446f3c2

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import dynamic from 'next/dynamic';
2+
3+
import {Repos} from '../../../../types/common';
4+
import {getGithubUrl, getReadmeUrl, mappingOptions} from '../../utils';
5+
6+
const getterOptions = {repoName: Repos.Uikit, componentName: 'Hotkey'};
7+
8+
export const hotkeyConfig = {
9+
id: 'hotkey',
10+
title: 'Hotkey',
11+
githubUrl: getGithubUrl(getterOptions),
12+
content: {
13+
readmeUrl: getReadmeUrl(getterOptions),
14+
},
15+
sandbox: {
16+
component: dynamic(() => import('@gravity-ui/uikit').then((mod) => mod.Hotkey)),
17+
props: {
18+
value: {
19+
type: 'input',
20+
defaultValue: 'mod+a mod+c mod+v',
21+
},
22+
view: {
23+
type: 'select',
24+
values: mappingOptions(['light', 'dark']),
25+
},
26+
platform: {
27+
type: 'select',
28+
values: mappingOptions(['pc', 'mac']),
29+
},
30+
},
31+
},
32+
};

src/content/components/uikit/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {checkboxConfig} from './Checkbox';
1515
import {disclosureConfig} from './Disclosure';
1616
import {dropdownMenuConfig} from './DropdownMenu';
1717
import {helpMarkConfig} from './HelpMark';
18+
import {hotkeyConfig} from './Hotkey';
1819
import {iconConfig} from './Icon';
1920
import {labelConfig} from './Label';
2021
import {linkConfig} from './Link';
@@ -99,6 +100,7 @@ const uikitComponents: Component[] = [
99100
sheetConfig,
100101
stepperConfig,
101102
helpMarkConfig,
103+
hotkeyConfig,
102104
];
103105

104106
export const uikit: Lib = {

0 commit comments

Comments
 (0)