Skip to content

Commit a3795a3

Browse files
authored
feat(HelpMark): add HelpMark docs (#508)
1 parent 899293d commit a3795a3

File tree

4 files changed

+39
-7
lines changed

4 files changed

+39
-7
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import {HelpMark} from '@gravity-ui/uikit';
2+
import type {HelpMarkProps} from '@gravity-ui/uikit';
3+
import React from 'react';
4+
5+
type HelpMarkComponentProps = Pick<HelpMarkProps, 'iconSize'>;
6+
7+
export const HelpMarkComponent = ({iconSize}: HelpMarkComponentProps) => {
8+
return <HelpMark iconSize={iconSize}>Some content</HelpMark>;
9+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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: 'HelpMark'};
7+
8+
export const helpMarkConfig = {
9+
id: 'help-mark',
10+
title: 'HelpMark',
11+
githubUrl: getGithubUrl(getterOptions),
12+
content: {
13+
readmeUrl: getReadmeUrl(getterOptions),
14+
},
15+
sandbox: {
16+
component: dynamic(() =>
17+
import('./HelpMarkComponent').then((mod) => mod.HelpMarkComponent),
18+
),
19+
props: {
20+
iconSize: {
21+
type: 'select',
22+
values: mappingOptions(['s', 'm', 'l', 'xl']),
23+
defaultValue: 'm',
24+
},
25+
},
26+
},
27+
};

src/content/components/uikit/Popover/PopoverComponent.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@ import {Button, Popover} from '@gravity-ui/uikit';
22
import type {PopoverProps} from '@gravity-ui/uikit';
33
import React from 'react';
44

5-
type PopupComponentProps = {
6-
open?: boolean;
7-
placement?: PopoverProps['placement'];
8-
hasArrow?: boolean;
9-
disabled?: boolean;
10-
trigger?: PopoverProps['trigger'];
11-
};
5+
type PopupComponentProps = Pick<PopoverProps, 'placement' | 'hasArrow' | 'disabled' | 'trigger'>;
126

137
export const PopoverComponent = ({disabled, trigger, placement, hasArrow}: PopupComponentProps) => {
148
return (

src/content/components/uikit/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {buttonConfig} from './Button';
1313
import {cardConfig} from './Card';
1414
import {checkboxConfig} from './Checkbox';
1515
import {dropdownMenuConfig} from './DropdownMenu';
16+
import {helpMarkConfig} from './HelpMark';
1617
import {iconConfig} from './Icon';
1718
import {labelConfig} from './Label';
1819
import {linkConfig} from './Link';
@@ -95,6 +96,7 @@ const uikitComponents: Component[] = [
9596
userLabelConfig,
9697
sheetConfig,
9798
stepperConfig,
99+
helpMarkConfig,
98100
];
99101

100102
export const uikit: Lib = {

0 commit comments

Comments
 (0)