Skip to content

Commit 3f91b69

Browse files
feat: added landing docs and playground for Disclosure component (#512)
* feat: added proper disclosure sandbox * fix: removed left and right arrow position options * chore: updated uikit lib version
1 parent 37ba4b8 commit 3f91b69

File tree

4 files changed

+90
-61
lines changed

4 files changed

+90
-61
lines changed

package-lock.json

Lines changed: 50 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@gravity-ui/markdown-editor": "^15.1.0",
1717
"@gravity-ui/navigation": "^3.7.5",
1818
"@gravity-ui/page-constructor": "^6.0.0-beta.6",
19-
"@gravity-ui/uikit": "^7.26.0",
19+
"@gravity-ui/uikit": "^7.26.1",
2020
"@gravity-ui/uikit-themer": "^1.4.1",
2121
"@mdx-js/mdx": "^2.3.0",
2222
"@mdx-js/react": "^2.3.0",
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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: 'Disclosure'};
7+
8+
export const disclosureConfig = {
9+
id: 'disclosure',
10+
title: 'Disclosure',
11+
githubUrl: getGithubUrl(getterOptions),
12+
isSupportRTL: true,
13+
content: {
14+
readmeUrl: getReadmeUrl(getterOptions),
15+
},
16+
sandbox: {
17+
component: dynamic(() => import('@gravity-ui/uikit').then((mod) => mod.Disclosure)),
18+
props: {
19+
size: {
20+
type: 'radioButton',
21+
values: mappingOptions(['m', 'l', 'xl']),
22+
defaultValue: 'm',
23+
},
24+
disabled: {
25+
type: 'switch',
26+
defaultValue: false,
27+
},
28+
arrowPosition: {
29+
type: 'radioButton',
30+
values: mappingOptions(['start', 'end']),
31+
defaultValue: 'start',
32+
},
33+
summary: {type: 'input', defaultValue: 'Disclosure summary'},
34+
children: {type: 'input', defaultValue: 'Disclosure content'},
35+
},
36+
},
37+
};

src/content/components/uikit/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {breadcrumbsConfig} from './Breadcrumbs';
1212
import {buttonConfig} from './Button';
1313
import {cardConfig} from './Card';
1414
import {checkboxConfig} from './Checkbox';
15+
import {disclosureConfig} from './Disclosure';
1516
import {dropdownMenuConfig} from './DropdownMenu';
1617
import {helpMarkConfig} from './HelpMark';
1718
import {iconConfig} from './Icon';
@@ -61,6 +62,7 @@ const uikitComponents: Component[] = [
6162
buttonConfig,
6263
cardConfig,
6364
checkboxConfig,
65+
disclosureConfig,
6466
dropdownMenuConfig,
6567
iconConfig,
6668
labelConfig,

0 commit comments

Comments
 (0)