@jetbrains/ring-ui-built 7.0.15 → 7.0.17
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 +7 -8
- package/components/_helpers/button__classes.js +10 -3
- package/components/_helpers/caption.js +1 -1
- package/components/_helpers/dialog__body-scroll-preventer.js +1 -1
- package/components/auth-dialog-service/auth-dialog-service.d.ts +1 -1
- package/components/avatar/avatar.d.ts +1 -1
- package/components/button/button.d.ts +5 -1
- package/components/button/button.js +6 -3
- package/components/button/button__classes.d.ts +1 -1
- package/components/button-group/button-group.js +4 -2
- package/components/confirm/confirm.d.ts +1 -1
- package/components/contenteditable/contenteditable.d.ts +1 -1
- package/components/date-picker/date-picker.d.ts +1 -1
- package/components/dialog/dialog.d.ts +1 -1
- package/components/dropdown/dropdown.d.ts +4 -2
- package/components/dropdown-menu/dropdown-menu.d.ts +7 -5
- package/components/dropdown-menu/dropdown-menu.js +33 -17
- package/components/global/focus-sensor-hoc.d.ts +1 -1
- package/components/global/focus-sensor-hoc.js +3 -1
- package/components/header/header.d.ts +1 -1
- package/components/header/header.js +1 -0
- package/components/header/profile.d.ts +2 -2
- package/components/header/profile.js +1 -0
- package/components/header/smart-profile.js +1 -0
- package/components/icon/icon.d.ts +1 -1
- package/components/input/input.d.ts +1 -1
- package/components/list/list.d.ts +1 -1
- package/components/list/list.js +2 -0
- package/components/list/list__users-groups-source.js +1 -0
- package/components/loader-inline/loader-inline.d.ts +1 -1
- package/components/login-dialog/login-dialog.d.ts +1 -1
- package/components/message/message.d.ts +1 -1
- package/components/pager/pager.d.ts +1 -1
- package/components/popup/popup.d.ts +3 -2
- package/components/popup/popup.js +5 -7
- package/components/popup-menu/popup-menu.d.ts +1 -1
- package/components/popup-menu/popup-menu.js +1 -0
- package/components/progress-bar/progress-bar.d.ts +1 -1
- package/components/query-assist/query-assist.d.ts +1 -1
- package/components/query-assist/query-assist.js +1 -0
- package/components/query-assist/query-assist__suggestions.js +1 -0
- package/components/select/select.d.ts +3 -3
- package/components/select/select__filter.js +1 -0
- package/components/select/select__popup.d.ts +1 -1
- package/components/select/select__popup.js +1 -0
- package/components/style.css +1 -1
- package/components/table/header.d.ts +1 -1
- package/components/table/row.d.ts +1 -1
- package/components/tabs/collapsible-more.js +1 -0
- package/components/tabs/collapsible-tabs.js +1 -0
- package/components/tabs/dumb-tabs.d.ts +2 -1
- package/components/tabs/dumb-tabs.js +1 -0
- package/components/tabs/smart-tabs.js +1 -0
- package/components/tabs/tabs.js +1 -0
- package/components/tag/tag.d.ts +1 -1
- package/components/tag/tag.js +1 -1
- package/components/tags-input/tags-input.d.ts +1 -1
- package/components/tags-list/tags-list.d.ts +1 -1
- package/components/toggle/toggle.d.ts +1 -1
- package/components/tooltip/tooltip.d.ts +1 -1
- package/components/upload/upload.d.ts +19 -0
- package/components/upload/upload.js +88 -0
- package/components/user-agreement/user-agreement.d.ts +1 -1
- package/components/user-card/card.d.ts +1 -1
- package/components/user-card/tooltip.d.ts +1 -1
- package/package.json +12 -4
@@ -31,4 +31,4 @@ export default class Header extends PureComponent<HeaderProps> {
|
|
31
31
|
createCells(widths?: never[]): import("react/jsx-runtime").JSX.Element[];
|
32
32
|
render(): import("react/jsx-runtime").JSX.Element;
|
33
33
|
}
|
34
|
-
export type HeaderAttrs = JSX.LibraryManagedAttributes<typeof Header, HeaderProps>;
|
34
|
+
export type HeaderAttrs = React.JSX.LibraryManagedAttributes<typeof Header, HeaderProps>;
|
@@ -58,4 +58,4 @@ export default class Row<T extends SelectionItem> extends PureComponent<RowProps
|
|
58
58
|
composedRowRef: import("memoize-one").MemoizedFn<(...refs: (React.Ref<HTMLElement> | undefined)[]) => (value: HTMLElement | null) => void>;
|
59
59
|
render(): import("react/jsx-runtime").JSX.Element;
|
60
60
|
}
|
61
|
-
export type RowAttrs<T extends SelectionItem> = JSX.LibraryManagedAttributes<typeof Row, RowProps<T>>;
|
61
|
+
export type RowAttrs<T extends SelectionItem> = React.JSX.LibraryManagedAttributes<typeof Row, RowProps<T>>;
|
@@ -29,6 +29,7 @@ import 'core-js/modules/es.array.sort.js';
|
|
29
29
|
import '../popup/popup.target.js';
|
30
30
|
import '../list/list.js';
|
31
31
|
import 'core-js/modules/es.symbol.description.js';
|
32
|
+
import 'core-js/modules/es.string.trim.js';
|
32
33
|
import 'react-virtualized/dist/es/List';
|
33
34
|
import 'react-virtualized/dist/es/AutoSizer';
|
34
35
|
import 'react-virtualized/dist/es/WindowScroller';
|
@@ -31,6 +31,7 @@ import 'core-js/modules/es.array.sort.js';
|
|
31
31
|
import '../popup/popup.target.js';
|
32
32
|
import '../list/list.js';
|
33
33
|
import 'core-js/modules/es.symbol.description.js';
|
34
|
+
import 'core-js/modules/es.string.trim.js';
|
34
35
|
import 'react-virtualized/dist/es/List';
|
35
36
|
import 'react-virtualized/dist/es/AutoSizer';
|
36
37
|
import 'react-virtualized/dist/es/WindowScroller';
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { PureComponent, ReactElement } from 'react';
|
2
|
+
import * as React from 'react';
|
2
3
|
import { CollapsibleTabsProps } from './collapsible-tabs';
|
3
4
|
import { CustomItem } from './custom-item';
|
4
5
|
import { TabProps } from './tab';
|
@@ -17,5 +18,5 @@ declare class Tabs extends PureComponent<TabsProps> {
|
|
17
18
|
getTabTitle: (child: ReactElement<TabProps>, i: number) => import("react/jsx-runtime").JSX.Element;
|
18
19
|
render(): import("react/jsx-runtime").JSX.Element;
|
19
20
|
}
|
20
|
-
export type TabsAttrs = JSX.LibraryManagedAttributes<typeof Tabs, TabsProps>;
|
21
|
+
export type TabsAttrs = React.JSX.LibraryManagedAttributes<typeof Tabs, TabsProps>;
|
21
22
|
export default Tabs;
|
@@ -34,6 +34,7 @@ import 'core-js/modules/es.array.sort.js';
|
|
34
34
|
import '../popup/popup.target.js';
|
35
35
|
import '../list/list.js';
|
36
36
|
import 'core-js/modules/es.symbol.description.js';
|
37
|
+
import 'core-js/modules/es.string.trim.js';
|
37
38
|
import 'react-virtualized/dist/es/List';
|
38
39
|
import 'react-virtualized/dist/es/AutoSizer';
|
39
40
|
import 'react-virtualized/dist/es/WindowScroller';
|
@@ -33,6 +33,7 @@ import 'core-js/modules/es.array.sort.js';
|
|
33
33
|
import '../popup/popup.target.js';
|
34
34
|
import '../list/list.js';
|
35
35
|
import 'core-js/modules/es.symbol.description.js';
|
36
|
+
import 'core-js/modules/es.string.trim.js';
|
36
37
|
import 'react-virtualized/dist/es/List';
|
37
38
|
import 'react-virtualized/dist/es/AutoSizer';
|
38
39
|
import 'react-virtualized/dist/es/WindowScroller';
|
package/components/tabs/tabs.js
CHANGED
@@ -36,6 +36,7 @@ import 'core-js/modules/es.array.sort.js';
|
|
36
36
|
import '../popup/popup.target.js';
|
37
37
|
import '../list/list.js';
|
38
38
|
import 'core-js/modules/es.symbol.description.js';
|
39
|
+
import 'core-js/modules/es.string.trim.js';
|
39
40
|
import 'react-virtualized/dist/es/List';
|
40
41
|
import 'react-virtualized/dist/es/AutoSizer';
|
41
42
|
import 'react-virtualized/dist/es/WindowScroller';
|
package/components/tag/tag.d.ts
CHANGED
@@ -43,4 +43,4 @@ export default class Tag extends PureComponent<TagProps> {
|
|
43
43
|
renderRemoveIcon(): import("react/jsx-runtime").JSX.Element | null;
|
44
44
|
render(): import("react/jsx-runtime").JSX.Element;
|
45
45
|
}
|
46
|
-
export type TagAttrs = JSX.LibraryManagedAttributes<typeof Tag, TagProps>;
|
46
|
+
export type TagAttrs = React.JSX.LibraryManagedAttributes<typeof Tag, TagProps>;
|
package/components/tag/tag.js
CHANGED
@@ -112,7 +112,7 @@ class Tag extends PureComponent {
|
|
112
112
|
iconClassName: styles.removeIcon,
|
113
113
|
onClick: this.props.onRemove,
|
114
114
|
style: {
|
115
|
-
'--ring-
|
115
|
+
'--ring-secondary-color': this.props.textColor
|
116
116
|
},
|
117
117
|
height: ControlsHeight.M
|
118
118
|
});
|
@@ -109,5 +109,5 @@ export default class TagsInput extends PureComponent<TagsInputProps, TagsInputSt
|
|
109
109
|
render(): import("react/jsx-runtime").JSX.Element;
|
110
110
|
}
|
111
111
|
export declare const RerenderableTagsInput: React.ForwardRefExoticComponent<TagsInputProps & React.RefAttributes<TagsInput>>;
|
112
|
-
export type TagsInputAttrs = JSX.LibraryManagedAttributes<typeof TagsInput, TagsInputProps>;
|
112
|
+
export type TagsInputAttrs = React.JSX.LibraryManagedAttributes<typeof TagsInput, TagsInputProps>;
|
113
113
|
export {};
|
@@ -30,5 +30,5 @@ export default class TagsList<T extends TagType> extends Component<TagsListProps
|
|
30
30
|
renderTag(tag: T, focusTag: boolean): import("react/jsx-runtime").JSX.Element;
|
31
31
|
render(): import("react/jsx-runtime").JSX.Element;
|
32
32
|
}
|
33
|
-
export type TagsListAttrs<T extends TagType = TagType> = JSX.LibraryManagedAttributes<typeof TagsList, TagsListProps<T>>;
|
33
|
+
export type TagsListAttrs<T extends TagType = TagType> = React.JSX.LibraryManagedAttributes<typeof TagsList, TagsListProps<T>>;
|
34
34
|
export {};
|
@@ -19,5 +19,5 @@ declare class Toggle extends PureComponent<ToggleProps> {
|
|
19
19
|
};
|
20
20
|
render(): import("react/jsx-runtime").JSX.Element;
|
21
21
|
}
|
22
|
-
export type ToggleAttrs = JSX.LibraryManagedAttributes<typeof Toggle, ToggleProps>;
|
22
|
+
export type ToggleAttrs = React.JSX.LibraryManagedAttributes<typeof Toggle, ToggleProps>;
|
23
23
|
export default Toggle;
|
@@ -56,5 +56,5 @@ export default class Tooltip extends Component<TooltipProps> {
|
|
56
56
|
onNestedTooltipHide: () => void;
|
57
57
|
render(): import("react/jsx-runtime").JSX.Element;
|
58
58
|
}
|
59
|
-
export type TooltipAttrs = JSX.LibraryManagedAttributes<typeof Tooltip, TooltipProps>;
|
59
|
+
export type TooltipAttrs = React.JSX.LibraryManagedAttributes<typeof Tooltip, TooltipProps>;
|
60
60
|
export {};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { ReactNode } from 'react';
|
2
|
+
export type UploadVariant = 'empty' | 'error' | 'success';
|
3
|
+
interface Props {
|
4
|
+
className?: string;
|
5
|
+
onFilesSelected: (files: File[]) => void;
|
6
|
+
onFilesRejected?: (files: File[]) => void;
|
7
|
+
validate?: (file: File) => boolean;
|
8
|
+
multiple?: HTMLInputElement['multiple'];
|
9
|
+
renderIcon?: () => ReactNode;
|
10
|
+
accept?: HTMLInputElement['accept'];
|
11
|
+
disabled?: boolean;
|
12
|
+
variant?: UploadVariant;
|
13
|
+
children?: ReactNode;
|
14
|
+
}
|
15
|
+
export type UploadHandle = {
|
16
|
+
openFilePicker: () => void;
|
17
|
+
};
|
18
|
+
export declare const Upload: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<UploadHandle>>;
|
19
|
+
export default Upload;
|
@@ -0,0 +1,88 @@
|
|
1
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
3
|
+
import { forwardRef, useRef, useState, useImperativeHandle, useCallback } from 'react';
|
4
|
+
import classNames from 'classnames';
|
5
|
+
import attachmentIcon from '@jetbrains/icons/attachment';
|
6
|
+
import Icon from '../icon/icon.js';
|
7
|
+
import '../_helpers/_rollupPluginBabelHelpers.js';
|
8
|
+
import 'util-deprecate';
|
9
|
+
import '../icon/icon__constants.js';
|
10
|
+
import '../_helpers/icon__svg.js';
|
11
|
+
import 'core-js/modules/es.regexp.exec.js';
|
12
|
+
import 'core-js/modules/es.string.replace.js';
|
13
|
+
import '../global/memoize.js';
|
14
|
+
|
15
|
+
var styles = {"upload":"upload_rui_5064","success":"success_rui_5064","error":"error_rui_5064","dragOver":"dragOver_rui_5064","disabled":"disabled_rui_5064","invisibleFileInput":"invisibleFileInput_rui_5064","attachmentIcon":"attachmentIcon_rui_5064"};
|
16
|
+
|
17
|
+
const Upload = /*#__PURE__*/forwardRef(function Upload(_ref, ref) {
|
18
|
+
let {
|
19
|
+
children,
|
20
|
+
className,
|
21
|
+
onFilesSelected,
|
22
|
+
onFilesRejected,
|
23
|
+
validate = () => true,
|
24
|
+
variant = 'empty',
|
25
|
+
multiple,
|
26
|
+
renderIcon = () => jsx(Icon, {
|
27
|
+
className: styles.attachmentIcon,
|
28
|
+
glyph: attachmentIcon
|
29
|
+
}),
|
30
|
+
accept,
|
31
|
+
disabled
|
32
|
+
} = _ref;
|
33
|
+
const fileInputRef = useRef(null);
|
34
|
+
const [dragOver, setDragOver] = useState(false);
|
35
|
+
useImperativeHandle(ref, () => ({
|
36
|
+
openFilePicker: () => {
|
37
|
+
var _fileInputRef$current;
|
38
|
+
return (_fileInputRef$current = fileInputRef.current) === null || _fileInputRef$current === void 0 ? void 0 : _fileInputRef$current.click();
|
39
|
+
}
|
40
|
+
}), []);
|
41
|
+
const handleSelectedFiles = useCallback(files => {
|
42
|
+
if (!files.length) {
|
43
|
+
return;
|
44
|
+
}
|
45
|
+
const rejected = files.filter(file => !validate(file));
|
46
|
+
if (rejected.length > 0) {
|
47
|
+
onFilesRejected === null || onFilesRejected === void 0 || onFilesRejected(files);
|
48
|
+
return;
|
49
|
+
}
|
50
|
+
onFilesSelected(files);
|
51
|
+
}, [onFilesRejected, onFilesSelected, validate]);
|
52
|
+
const onDragEnter = useCallback(() => setDragOver(true), []);
|
53
|
+
const onDragOver = useCallback(e => e.preventDefault(), []);
|
54
|
+
const onDragLeave = useCallback(() => setDragOver(false), []);
|
55
|
+
const onInputChange = useCallback(() => {
|
56
|
+
var _fileInputRef$current2;
|
57
|
+
setDragOver(false);
|
58
|
+
if ((_fileInputRef$current2 = fileInputRef.current) !== null && _fileInputRef$current2 !== void 0 && _fileInputRef$current2.files) {
|
59
|
+
handleSelectedFiles(Array.from(fileInputRef.current.files));
|
60
|
+
}
|
61
|
+
}, [handleSelectedFiles]);
|
62
|
+
return jsxs("div", {
|
63
|
+
className: classNames(className, styles.upload, {
|
64
|
+
[styles.disabled]: disabled,
|
65
|
+
[styles.dragOver]: dragOver,
|
66
|
+
[styles.success]: variant === 'success',
|
67
|
+
[styles.error]: variant === 'error'
|
68
|
+
}),
|
69
|
+
"data-test": "ring-upload",
|
70
|
+
children: [jsx("input", {
|
71
|
+
onDragEnter: onDragEnter,
|
72
|
+
onDragOver: onDragOver,
|
73
|
+
onDragLeave: onDragLeave,
|
74
|
+
disabled: disabled,
|
75
|
+
ref: fileInputRef,
|
76
|
+
"data-test": "ring-file-input",
|
77
|
+
multiple: multiple,
|
78
|
+
accept: accept,
|
79
|
+
onChange: onInputChange,
|
80
|
+
type: "file",
|
81
|
+
autoComplete: "off",
|
82
|
+
"aria-label": "file-picker",
|
83
|
+
className: styles.invisibleFileInput
|
84
|
+
}), renderIcon(), children]
|
85
|
+
});
|
86
|
+
});
|
87
|
+
|
88
|
+
export { Upload, Upload as default };
|
@@ -38,5 +38,5 @@ export default class UserAgreement extends PureComponent<UserAgreementProps> {
|
|
38
38
|
onScrollToBottom: () => void;
|
39
39
|
render(): import("react/jsx-runtime").JSX.Element;
|
40
40
|
}
|
41
|
-
export type UserAgreementAttrs = JSX.LibraryManagedAttributes<typeof UserAgreement, UserAgreementProps>;
|
41
|
+
export type UserAgreementAttrs = React.JSX.LibraryManagedAttributes<typeof UserAgreement, UserAgreementProps>;
|
42
42
|
export {};
|
@@ -33,4 +33,4 @@ export default class UserCard extends PureComponent<UserCardProps> {
|
|
33
33
|
copyEmail: () => void;
|
34
34
|
render(): import("react/jsx-runtime").JSX.Element;
|
35
35
|
}
|
36
|
-
export type UserCardAttrs = JSX.LibraryManagedAttributes<typeof UserCard, UserCardProps>;
|
36
|
+
export type UserCardAttrs = React.JSX.LibraryManagedAttributes<typeof UserCard, UserCardProps>;
|
@@ -23,5 +23,5 @@ export default class UserCardTooltip extends Component<UserCardTooltipProps> {
|
|
23
23
|
};
|
24
24
|
render(): import("react/jsx-runtime").JSX.Element;
|
25
25
|
}
|
26
|
-
export type UserCardTooltipAttrs = JSX.LibraryManagedAttributes<typeof UserCardTooltip, UserCardTooltipProps>;
|
26
|
+
export type UserCardTooltipAttrs = React.JSX.LibraryManagedAttributes<typeof UserCardTooltip, UserCardTooltipProps>;
|
27
27
|
export {};
|
package/package.json
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "@jetbrains/ring-ui-built",
|
3
|
-
"version": "7.0.
|
3
|
+
"version": "7.0.17",
|
4
4
|
"description": "JetBrains UI library",
|
5
|
-
"author":
|
5
|
+
"author": {
|
6
|
+
"name": "JetBrains"
|
7
|
+
},
|
6
8
|
"license": "Apache-2.0",
|
7
9
|
"packageManager": "npm@8.11.0",
|
8
10
|
"files": [
|
@@ -42,6 +44,8 @@
|
|
42
44
|
"screenshots-test-ci": "npm --prefix packages/screenshots run test-ci",
|
43
45
|
"screenshots-gather": "npm --prefix packages/screenshots run gather",
|
44
46
|
"build-stories": "storybook build --quiet -c .storybook -o storybook-dist",
|
47
|
+
"chromatic": "npx chromatic --build-script-name build-stories --exit-once-uploaded",
|
48
|
+
"chromatic-local": "dotenv -- npm run publish-stories",
|
45
49
|
"prebuild": "rimraf components && tsc --project tsconfig-build.json && cpy './**/*' '!**/*.ts' '!**/*.tsx' '!**/__mocks__/**' ../components --parents --cwd=src/",
|
46
50
|
"build": "./node_modules/.bin/rollup -c --bundleConfigAsCjs",
|
47
51
|
"postbuild": "cpy './**/*.d.ts' ../dist --parents --cwd=components/",
|
@@ -69,7 +73,7 @@
|
|
69
73
|
},
|
70
74
|
"repository": {
|
71
75
|
"type": "git",
|
72
|
-
"url": "ssh://github.com/JetBrains/ring-ui.git"
|
76
|
+
"url": "git+ssh://git@github.com/JetBrains/ring-ui.git"
|
73
77
|
},
|
74
78
|
"readmeFilename": "README.md",
|
75
79
|
"devDependencies": {},
|
@@ -113,5 +117,9 @@
|
|
113
117
|
"engines": {
|
114
118
|
"node": ">=14.0",
|
115
119
|
"npm": ">=6.0.0"
|
116
|
-
}
|
120
|
+
},
|
121
|
+
"bugs": {
|
122
|
+
"url": "https://github.com/JetBrains/ring-ui/issues"
|
123
|
+
},
|
124
|
+
"homepage": "https://github.com/JetBrains/ring-ui#readme"
|
117
125
|
}
|