@jetbrains/ring-ui 5.0.0-beta.1 → 5.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -23
- package/components/avatar/avatar.d.ts +2 -2
- package/components/button/button.d.ts +6 -193
- package/components/dropdown/anchor.d.ts +2 -81
- package/components/header/tray-icon.d.ts +575 -19
- package/components/markdown/markdown.d.ts +0 -8
- package/components/markdown/markdown.jsx +7 -7
- package/components/message/message.d.ts +0 -16
- package/components/message/message.jsx +15 -15
- package/components/pager/pager.d.ts +5 -24
- package/components/pager/pager.jsx +18 -18
- package/components/select/select.d.ts +5 -3
- package/components/tabs/custom-item.d.ts +3 -5
- package/components/tabs/dumb-tabs.d.ts +3 -1
- package/dist/avatar/avatar.d.ts +2 -2
- package/dist/button/button.d.ts +6 -193
- package/dist/dropdown/anchor.d.ts +2 -81
- package/dist/header/tray-icon.d.ts +575 -19
- package/dist/markdown/markdown.d.ts +0 -8
- package/dist/markdown/markdown.js +3 -5
- package/dist/message/message.d.ts +0 -16
- package/dist/message/message.js +15 -15
- package/dist/pager/pager.d.ts +5 -24
- package/dist/pager/pager.js +20 -20
- package/dist/select/select.d.ts +5 -3
- package/dist/tabs/custom-item.d.ts +3 -5
- package/dist/tabs/dumb-tabs.d.ts +3 -1
- package/package.json +3 -5
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PureComponent } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import { ReactMarkdownProps } from 'react-markdown';
|
|
4
3
|
export interface BaseMarkdownProps {
|
|
5
4
|
source: string;
|
|
@@ -10,13 +9,6 @@ export declare type MarkdownProps = ReactMarkdownProps & BaseMarkdownProps;
|
|
|
10
9
|
* @name Markdown
|
|
11
10
|
*/
|
|
12
11
|
export default class Markdown extends PureComponent<MarkdownProps> {
|
|
13
|
-
static propTypes: {
|
|
14
|
-
inline: PropTypes.Requireable<boolean>;
|
|
15
|
-
source: PropTypes.Requireable<string>;
|
|
16
|
-
className: PropTypes.Requireable<string>;
|
|
17
|
-
renderers: PropTypes.Requireable<object>;
|
|
18
|
-
plugins: PropTypes.Requireable<any[]>;
|
|
19
|
-
};
|
|
20
12
|
render(): JSX.Element;
|
|
21
13
|
}
|
|
22
14
|
declare const md: (strings: TemplateStringsArray, ...interpolations: unknown[]) => void;
|
|
@@ -14,13 +14,6 @@ import styles from './markdown.css';
|
|
|
14
14
|
* @name Markdown
|
|
15
15
|
*/
|
|
16
16
|
export default class Markdown extends PureComponent {
|
|
17
|
-
static propTypes = {
|
|
18
|
-
inline: PropTypes.bool,
|
|
19
|
-
source: PropTypes.string,
|
|
20
|
-
className: PropTypes.string,
|
|
21
|
-
renderers: PropTypes.object,
|
|
22
|
-
plugins: PropTypes.array
|
|
23
|
-
};
|
|
24
17
|
render() {
|
|
25
18
|
const { className, renderers, inline, source, plugins = [], ...restProps } = this.props;
|
|
26
19
|
const classes = classNames(className, {
|
|
@@ -37,5 +30,12 @@ export default class Markdown extends PureComponent {
|
|
|
37
30
|
}} {...restProps}/>);
|
|
38
31
|
}
|
|
39
32
|
}
|
|
33
|
+
Markdown.propTypes = {
|
|
34
|
+
inline: PropTypes.bool,
|
|
35
|
+
source: PropTypes.string,
|
|
36
|
+
className: PropTypes.string,
|
|
37
|
+
renderers: PropTypes.object,
|
|
38
|
+
plugins: PropTypes.array
|
|
39
|
+
};
|
|
40
40
|
const md = trivialTemplateTag(source => <Markdown {...{ source }}/>);
|
|
41
41
|
export { md };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Component, ReactNode } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import Popup, { PopupAttrs } from '../popup/popup';
|
|
4
3
|
import { Directions } from '../popup/popup.consts';
|
|
5
4
|
import { IconType } from '../icon/icon';
|
|
@@ -30,21 +29,6 @@ interface MessageState {
|
|
|
30
29
|
* Displays a popup containing a message.
|
|
31
30
|
*/
|
|
32
31
|
export default class Message extends Component<MessageProps> {
|
|
33
|
-
static propTypes: {
|
|
34
|
-
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
35
|
-
className: PropTypes.Requireable<string>;
|
|
36
|
-
tailClassName: PropTypes.Requireable<string>;
|
|
37
|
-
title: PropTypes.Validator<string>;
|
|
38
|
-
icon: PropTypes.Requireable<PropTypes.ReactComponentLike>;
|
|
39
|
-
directions: PropTypes.Requireable<(string | null | undefined)[]>;
|
|
40
|
-
direction: PropTypes.Requireable<string>;
|
|
41
|
-
popupProps: PropTypes.Requireable<object>;
|
|
42
|
-
buttonProps: PropTypes.Requireable<object>;
|
|
43
|
-
tailOffset: PropTypes.Requireable<number>;
|
|
44
|
-
onClose: PropTypes.Requireable<(...args: any[]) => any>;
|
|
45
|
-
onDismiss: PropTypes.Requireable<(...args: any[]) => any>;
|
|
46
|
-
translations: PropTypes.Requireable<object>;
|
|
47
|
-
};
|
|
48
32
|
static defaultProps: {
|
|
49
33
|
icon: string;
|
|
50
34
|
directions: Directions[];
|
|
@@ -29,21 +29,6 @@ const getTailOffsets = (offset) => ({
|
|
|
29
29
|
* Displays a popup containing a message.
|
|
30
30
|
*/
|
|
31
31
|
export default class Message extends Component {
|
|
32
|
-
static propTypes = {
|
|
33
|
-
children: PropTypes.node,
|
|
34
|
-
className: PropTypes.string,
|
|
35
|
-
tailClassName: PropTypes.string,
|
|
36
|
-
title: PropTypes.string.isRequired,
|
|
37
|
-
icon: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),
|
|
38
|
-
directions: PropTypes.arrayOf(PropTypes.string),
|
|
39
|
-
direction: PropTypes.string,
|
|
40
|
-
popupProps: PropTypes.object,
|
|
41
|
-
buttonProps: PropTypes.object,
|
|
42
|
-
tailOffset: PropTypes.number,
|
|
43
|
-
onClose: PropTypes.func,
|
|
44
|
-
onDismiss: PropTypes.func,
|
|
45
|
-
translations: PropTypes.object
|
|
46
|
-
};
|
|
47
32
|
static defaultProps = {
|
|
48
33
|
icon: gift,
|
|
49
34
|
directions: [
|
|
@@ -104,3 +89,18 @@ export default class Message extends Component {
|
|
|
104
89
|
</Popup>);
|
|
105
90
|
}
|
|
106
91
|
}
|
|
92
|
+
Message.propTypes = {
|
|
93
|
+
children: PropTypes.node,
|
|
94
|
+
className: PropTypes.string,
|
|
95
|
+
tailClassName: PropTypes.string,
|
|
96
|
+
title: PropTypes.string.isRequired,
|
|
97
|
+
icon: PropTypes.oneOfType([PropTypes.string, PropTypes.elementType]),
|
|
98
|
+
directions: PropTypes.arrayOf(PropTypes.string),
|
|
99
|
+
direction: PropTypes.string,
|
|
100
|
+
popupProps: PropTypes.object,
|
|
101
|
+
buttonProps: PropTypes.object,
|
|
102
|
+
tailOffset: PropTypes.number,
|
|
103
|
+
onClose: PropTypes.func,
|
|
104
|
+
onDismiss: PropTypes.func,
|
|
105
|
+
translations: PropTypes.object
|
|
106
|
+
};
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
* @name Pager
|
|
3
3
|
*/
|
|
4
4
|
import React, { PureComponent, ReactNode } from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
5
|
import { SelectItem } from '../select/select';
|
|
7
6
|
export interface PagerTranslations {
|
|
8
|
-
perPage:
|
|
9
|
-
firstPage:
|
|
10
|
-
lastPage:
|
|
11
|
-
nextPage:
|
|
12
|
-
previousPage:
|
|
7
|
+
perPage: string;
|
|
8
|
+
firstPage: string;
|
|
9
|
+
lastPage: string;
|
|
10
|
+
nextPage: string;
|
|
11
|
+
previousPage: string;
|
|
13
12
|
}
|
|
14
13
|
export interface PagerProps {
|
|
15
14
|
total: number;
|
|
@@ -33,24 +32,6 @@ interface PagerSizeItem {
|
|
|
33
32
|
key: number;
|
|
34
33
|
}
|
|
35
34
|
export default class Pager extends PureComponent<PagerProps> {
|
|
36
|
-
static propTypes: {
|
|
37
|
-
total: PropTypes.Validator<number>;
|
|
38
|
-
currentPage: PropTypes.Requireable<number>;
|
|
39
|
-
pageSize: PropTypes.Requireable<number>;
|
|
40
|
-
pageSizes: PropTypes.Requireable<(number | null | undefined)[]>;
|
|
41
|
-
visiblePagesLimit: PropTypes.Requireable<number>;
|
|
42
|
-
disablePageSizeSelector: PropTypes.Requireable<boolean>;
|
|
43
|
-
openTotal: PropTypes.Requireable<boolean>;
|
|
44
|
-
canLoadLastPageWithOpenTotal: PropTypes.Requireable<boolean>;
|
|
45
|
-
onPageChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
46
|
-
onPageSizeChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
47
|
-
onLoadPage: PropTypes.Requireable<(...args: any[]) => any>;
|
|
48
|
-
className: PropTypes.Requireable<string>;
|
|
49
|
-
translations: PropTypes.Requireable<object>;
|
|
50
|
-
loader: PropTypes.Requireable<boolean>;
|
|
51
|
-
loaderNavigation: PropTypes.Requireable<boolean>;
|
|
52
|
-
hrefFunc: PropTypes.Requireable<(...args: any[]) => any>;
|
|
53
|
-
};
|
|
54
35
|
static defaultProps: {
|
|
55
36
|
currentPage: number;
|
|
56
37
|
pageSize: number;
|
|
@@ -15,24 +15,6 @@ import Link from '../link/link';
|
|
|
15
15
|
import Icon from '../icon/icon';
|
|
16
16
|
import style from './pager.css';
|
|
17
17
|
export default class Pager extends PureComponent {
|
|
18
|
-
static propTypes = {
|
|
19
|
-
total: PropTypes.number.isRequired,
|
|
20
|
-
currentPage: PropTypes.number,
|
|
21
|
-
pageSize: PropTypes.number,
|
|
22
|
-
pageSizes: PropTypes.arrayOf(PropTypes.number),
|
|
23
|
-
visiblePagesLimit: PropTypes.number,
|
|
24
|
-
disablePageSizeSelector: PropTypes.bool,
|
|
25
|
-
openTotal: PropTypes.bool,
|
|
26
|
-
canLoadLastPageWithOpenTotal: PropTypes.bool,
|
|
27
|
-
onPageChange: PropTypes.func,
|
|
28
|
-
onPageSizeChange: PropTypes.func,
|
|
29
|
-
onLoadPage: PropTypes.func,
|
|
30
|
-
className: PropTypes.string,
|
|
31
|
-
translations: PropTypes.object,
|
|
32
|
-
loader: PropTypes.bool,
|
|
33
|
-
loaderNavigation: PropTypes.bool,
|
|
34
|
-
hrefFunc: PropTypes.func //function which generates href for all pager's buttons based on pager state passed as a function parameter, either this function or onPageChange should be provided
|
|
35
|
-
};
|
|
36
18
|
static defaultProps = {
|
|
37
19
|
currentPage: 1,
|
|
38
20
|
pageSize: 50,
|
|
@@ -234,3 +216,21 @@ export default class Pager extends PureComponent {
|
|
|
234
216
|
</div>);
|
|
235
217
|
}
|
|
236
218
|
}
|
|
219
|
+
Pager.propTypes = {
|
|
220
|
+
total: PropTypes.number.isRequired,
|
|
221
|
+
currentPage: PropTypes.number,
|
|
222
|
+
pageSize: PropTypes.number,
|
|
223
|
+
pageSizes: PropTypes.arrayOf(PropTypes.number),
|
|
224
|
+
visiblePagesLimit: PropTypes.number,
|
|
225
|
+
disablePageSizeSelector: PropTypes.bool,
|
|
226
|
+
openTotal: PropTypes.bool,
|
|
227
|
+
canLoadLastPageWithOpenTotal: PropTypes.bool,
|
|
228
|
+
onPageChange: PropTypes.func,
|
|
229
|
+
onPageSizeChange: PropTypes.func,
|
|
230
|
+
onLoadPage: PropTypes.func,
|
|
231
|
+
className: PropTypes.string,
|
|
232
|
+
translations: PropTypes.object,
|
|
233
|
+
loader: PropTypes.bool,
|
|
234
|
+
loaderNavigation: PropTypes.bool,
|
|
235
|
+
hrefFunc: PropTypes.func //function which generates href for all pager's buttons based on pager state passed as a function parameter, either this function or onPageChange should be provided
|
|
236
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ButtonHTMLAttributes, Component, CSSProperties,
|
|
1
|
+
import React, { ButtonHTMLAttributes, Component, CSSProperties, HTMLAttributes, ReactNode, RefCallback, SyntheticEvent } from 'react';
|
|
2
2
|
import { SelectHandlerParams } from '../list/list';
|
|
3
3
|
import { Size } from '../input/input';
|
|
4
4
|
import Theme from '../global/theme';
|
|
@@ -40,8 +40,10 @@ export interface DataTestProps {
|
|
|
40
40
|
'data-test'?: string | null | undefined;
|
|
41
41
|
}
|
|
42
42
|
export interface CustomAnchorProps {
|
|
43
|
-
wrapperProps:
|
|
44
|
-
|
|
43
|
+
wrapperProps: HTMLAttributes<HTMLElement> & DataTestProps & {
|
|
44
|
+
ref: RefCallback<HTMLElement>;
|
|
45
|
+
};
|
|
46
|
+
buttonProps: ButtonHTMLAttributes<HTMLButtonElement> & DataTestProps;
|
|
45
47
|
popup: ReactNode;
|
|
46
48
|
}
|
|
47
49
|
export interface BaseSelectProps<T = unknown> {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { ReactElement
|
|
3
|
-
|
|
4
|
-
children?: ReactNode;
|
|
5
|
-
}
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
import { TabProps } from './tab';
|
|
6
4
|
export declare const CustomItem: {
|
|
7
|
-
({ children }:
|
|
5
|
+
({ children }: TabProps): ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
8
6
|
propTypes: {
|
|
9
7
|
children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
|
|
10
8
|
};
|
|
@@ -5,7 +5,9 @@ import { CollapsibleTabsProps } from './collapsible-tabs';
|
|
|
5
5
|
import { CustomItem } from './custom-item';
|
|
6
6
|
import { TabProps } from './tab';
|
|
7
7
|
export { CustomItem };
|
|
8
|
-
|
|
8
|
+
declare type Children = readonly Children[] | ReactElement<TabProps> | null | boolean;
|
|
9
|
+
export interface TabsProps extends ThemeProps, Omit<CollapsibleTabsProps, 'onSelect' | 'children'> {
|
|
10
|
+
children: Children;
|
|
9
11
|
onSelect: (key: string) => void;
|
|
10
12
|
className?: string | null | undefined;
|
|
11
13
|
autoCollapse?: boolean | null | undefined;
|
package/dist/avatar/avatar.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PureComponent,
|
|
1
|
+
import { PureComponent, ImgHTMLAttributes } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
/**
|
|
4
4
|
* @name Avatar
|
|
@@ -13,7 +13,7 @@ export declare enum Size {
|
|
|
13
13
|
Size48 = 48,
|
|
14
14
|
Size56 = 56
|
|
15
15
|
}
|
|
16
|
-
export interface AvatarProps extends
|
|
16
|
+
export interface AvatarProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
17
17
|
dpr: number;
|
|
18
18
|
size: Size;
|
|
19
19
|
subavatarSize: number;
|