@jetbrains/ring-ui-built 7.0.14 → 7.0.16
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/iframe-flow.js +4 -0
- package/components/auth-dialog/auth-dialog.js +4 -0
- package/components/auth-dialog-service/auth-dialog-service.d.ts +1 -1
- package/components/auth-dialog-service/auth-dialog-service.js +4 -0
- 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/confirm/confirm.js +5 -1
- package/components/confirm-service/confirm-service.js +4 -0
- 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/dialog/dialog.js +31 -14
- 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 +32 -17
- package/components/global/focus-sensor-hoc.d.ts +1 -1
- package/components/header/header.d.ts +1 -1
- package/components/header/profile.d.ts +2 -2
- 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/loader-inline/loader-inline.d.ts +1 -1
- package/components/login-dialog/login-dialog.d.ts +1 -1
- package/components/login-dialog/login-dialog.js +4 -0
- package/components/login-dialog/service.js +4 -0
- package/components/message/message.d.ts +1 -1
- package/components/pager/pager.d.ts +1 -1
- package/components/popup/popup.d.ts +2 -2
- package/components/popup-menu/popup-menu.d.ts +1 -1
- package/components/progress-bar/progress-bar.d.ts +1 -1
- package/components/query-assist/query-assist.d.ts +1 -1
- package/components/select/select.d.ts +3 -3
- package/components/select/select__popup.d.ts +1 -1
- 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/dumb-tabs.d.ts +2 -1
- 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-agreement/user-agreement.js +5 -1
- package/components/user-card/card.d.ts +1 -1
- package/components/user-card/tooltip.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -3,6 +3,13 @@
|
|
3
3
|
|
4
4
|
[](https://github.com/JetBrains#jetbrains-on-github)
|
5
5
|
|
6
|
+
- [Design guildelines](https://www.jetbrains.com/help/ring-ui/welcome.html)
|
7
|
+
- [Usage examples in Storybook][docsite]
|
8
|
+
- [GitHub repository](https://github.com/JetBrains/ring-ui)
|
9
|
+
- [Issues in YouTrack](https://youtrack.jetbrains.com/issues/RG)
|
10
|
+
- [Builds in TeamCity][ci-project]
|
11
|
+
- [npm package][npm-package]
|
12
|
+
|
6
13
|
This collection of UI components aims to provide all the necessary building blocks for web-based products built inside JetBrains, as well as third-party plugins developed for JetBrains' products.
|
7
14
|
|
8
15
|
## Try now
|
@@ -84,14 +91,6 @@ in a same build process, you can use the following configuration:
|
|
84
91
|
|
85
92
|
See [CONTRIBUTING.md](./CONTRIBUTING.md)
|
86
93
|
|
87
|
-
## Links
|
88
|
-
|
89
|
-
- [Living style guide][docsite]
|
90
|
-
- [GitHub repository](https://github.com/JetBrains/ring-ui)
|
91
|
-
- [Issues in YouTrack](https://youtrack.jetbrains.com/issues/RG)
|
92
|
-
- [Builds in TeamCity][ci-project]
|
93
|
-
- [npm package][npm-package]
|
94
|
-
|
95
94
|
[docsite]: https://jetbrains.github.io/ring-ui
|
96
95
|
[ci-project]: https://teamcity.jetbrains.com/project.html?projectId=JetBrainsUi_RingUi&tab=projectOverview
|
97
96
|
[ci-bt]: https://teamcity.jetbrains.com/viewType.html?buildTypeId=JetBrainsUi_RingUi_GeminiTests&tab=buildTypeStatusDiv
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import classNames from 'classnames';
|
2
2
|
|
3
|
-
var styles = {"glyph":"glyph_rui_2d39","heightS":"heightS_rui_0b90","heightM":"heightM_rui_0b90","heightL":"heightL_rui_0b90","button":"button_rui_0b90","block":"block_rui_0b90","inline":"inline_rui_0b90","icon":"icon_rui_0b90","withNormalIcon":"withNormalIcon_rui_0b90","active":"active_rui_0b90","danger":"danger_rui_0b90","
|
3
|
+
var styles = {"glyph":"glyph_rui_2d39","heightS":"heightS_rui_0b90","heightM":"heightM_rui_0b90","heightL":"heightL_rui_0b90","button":"button_rui_0b90","block":"block_rui_0b90","inline":"inline_rui_0b90","icon":"icon_rui_0b90","withNormalIcon":"withNormalIcon_rui_0b90","active":"active_rui_0b90","disabled":"disabled_rui_0b90","danger":"danger_rui_0b90","flat":"flat_rui_0b90","whiteText":"whiteText_rui_0b90","primaryBlock":"primaryBlock_rui_0b90 flat_rui_0b90 whiteText_rui_0b90","success":"success_rui_0b90 flat_rui_0b90 whiteText_rui_0b90","error":"error_rui_0b90 flat_rui_0b90 whiteText_rui_0b90","secondary":"secondary_rui_0b90 flat_rui_0b90","ghost":"ghost_rui_0b90 flat_rui_0b90","iconOnly":"iconOnly_rui_0b90","loader":"loader_rui_0b90","loaderBackground":"loaderBackground_rui_0b90","progress":"progress_rui_0b90","delayed":"delayed_rui_0b90","short":"short_rui_0b90","dropdownIcon":"dropdownIcon_rui_0b90"};
|
4
4
|
|
5
5
|
function getButtonClasses(_ref) {
|
6
6
|
let {
|
@@ -9,6 +9,10 @@ function getButtonClasses(_ref) {
|
|
9
9
|
disabled,
|
10
10
|
loader,
|
11
11
|
primary,
|
12
|
+
success,
|
13
|
+
error,
|
14
|
+
secondary,
|
15
|
+
ghost,
|
12
16
|
short,
|
13
17
|
inline,
|
14
18
|
danger,
|
@@ -19,15 +23,18 @@ function getButtonClasses(_ref) {
|
|
19
23
|
} = _ref;
|
20
24
|
const iconOnly = icon && !children;
|
21
25
|
const primaryBlock = primary && !inline;
|
22
|
-
const withNormalIcon =
|
26
|
+
const withNormalIcon = iconOnly && inline && !active && !danger && !primary && !disabled;
|
23
27
|
return classNames(styles.button, className, styles["height".concat(height)], inline ? styles.inline : styles.block, {
|
24
28
|
[styles.active]: active,
|
25
29
|
[styles.danger]: danger,
|
26
30
|
[styles.delayed]: delayed,
|
27
31
|
[styles.withNormalIcon]: withNormalIcon,
|
28
32
|
[styles.loader]: loader,
|
29
|
-
[styles.primary]: primary,
|
30
33
|
[styles.primaryBlock]: primaryBlock,
|
34
|
+
[styles.success]: success,
|
35
|
+
[styles.error]: error,
|
36
|
+
[styles.secondary]: secondary,
|
37
|
+
[styles.ghost]: ghost,
|
31
38
|
[styles.short]: short,
|
32
39
|
[styles.disabled]: disabled,
|
33
40
|
[styles.iconOnly]: iconOnly
|
@@ -3,7 +3,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { PureComponent } from 'react';
|
4
4
|
import classNames from 'classnames';
|
5
5
|
|
6
|
-
var styles = {"button":"button_rui_0b90","active":"active_rui_0b90","
|
6
|
+
var styles = {"button":"button_rui_0b90","active":"active_rui_0b90","flat":"flat_rui_0b90","buttonGroup":"buttonGroup_rui_bbca common_rui_bbca buttonGroup_rui_f4fc","common":"common_rui_bbca","disabled":"disabled_rui_bbca","split":"split_rui_bbca common_rui_bbca buttonGroup_rui_f4fc","caption":"caption_rui_bbca font_rui_8bff","help":"help_rui_bbca"};
|
7
7
|
|
8
8
|
class Caption extends PureComponent {
|
9
9
|
render() {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import 'core-js/modules/web.dom-collections.iterator.js';
|
2
2
|
import scrollbarWidth from 'scrollbar-width';
|
3
3
|
|
4
|
-
var styles = {"header":"header_rui_1d72","scrollableWrapper":"scrollableWrapper_rui_1d72","container":"container_rui_381e","nativeDialog":"nativeDialog_rui_381e","innerContainer":"innerContainer_rui_381e","content":"content_rui_381e","panel":"panel_rui_381e","clickableOverlay":"clickableOverlay_rui_381e","closeIconOutside":"closeIconOutside_rui_381e","
|
4
|
+
var styles = {"header":"header_rui_1d72","scrollableWrapper":"scrollableWrapper_rui_1d72","container":"container_rui_381e","nativeDialog":"nativeDialog_rui_381e","innerContainer":"innerContainer_rui_381e","content":"content_rui_381e","panel":"panel_rui_381e","clickableOverlay":"clickableOverlay_rui_381e","closeIconOutside":"closeIconOutside_rui_381e","closeIcon":"closeIcon_rui_381e","closeButton":"closeButton_rui_381e","closeButtonOutside":"closeButtonOutside_rui_381e","closeButtonInside":"closeButtonInside_rui_381e","documentWithoutScroll":"documentWithoutScroll_rui_381e","popupTarget":"popupTarget_rui_381e","dense":"dense_rui_381e"};
|
5
5
|
|
6
6
|
const isPrevented = new Set();
|
7
7
|
let previousDocumentWidth = null;
|
@@ -42,6 +42,10 @@ import '../global/memoize.js';
|
|
42
42
|
import '../link/clickableLink.js';
|
43
43
|
import '../_helpers/button__classes.js';
|
44
44
|
import '../popup/popup.target.js';
|
45
|
+
import '../popup/popup.js';
|
46
|
+
import '../popup/position.js';
|
47
|
+
import 'core-js/modules/es.array.sort.js';
|
48
|
+
import '../popup/popup.consts.js';
|
45
49
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
46
50
|
import 'scrollbar-width';
|
47
51
|
import '../loader-screen/loader-screen.js';
|
@@ -28,6 +28,10 @@ import 'sniffr';
|
|
28
28
|
import '../tab-trap/tab-trap.js';
|
29
29
|
import '../global/dom.js';
|
30
30
|
import '../popup/popup.target.js';
|
31
|
+
import '../popup/popup.js';
|
32
|
+
import '../popup/position.js';
|
33
|
+
import 'core-js/modules/es.array.sort.js';
|
34
|
+
import '../popup/popup.consts.js';
|
31
35
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
32
36
|
import 'scrollbar-width';
|
33
37
|
import '@jetbrains/icons/chevron-down';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import AuthDialog, { AuthDialogProps } from '../auth-dialog/auth-dialog';
|
2
2
|
export declare const reactRoot: import("react-dom/client").Root;
|
3
|
-
type AuthDialogAttributes = JSX.LibraryManagedAttributes<typeof AuthDialog, AuthDialogProps>;
|
3
|
+
type AuthDialogAttributes = React.JSX.LibraryManagedAttributes<typeof AuthDialog, AuthDialogProps>;
|
4
4
|
export default function showAuthDialog(props?: AuthDialogAttributes): () => void;
|
5
5
|
export {};
|
@@ -39,6 +39,10 @@ import '../global/memoize.js';
|
|
39
39
|
import '../link/clickableLink.js';
|
40
40
|
import '../_helpers/button__classes.js';
|
41
41
|
import '../popup/popup.target.js';
|
42
|
+
import '../popup/popup.js';
|
43
|
+
import '../popup/position.js';
|
44
|
+
import 'core-js/modules/es.array.sort.js';
|
45
|
+
import '../popup/popup.consts.js';
|
42
46
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
43
47
|
import 'scrollbar-width';
|
44
48
|
import '../heading/heading.js';
|
@@ -36,4 +36,4 @@ export default class Avatar extends PureComponent<AvatarProps> {
|
|
36
36
|
handleSuccess: () => void;
|
37
37
|
render(): import("react/jsx-runtime").JSX.Element;
|
38
38
|
}
|
39
|
-
export type AvatarAttrs = JSX.LibraryManagedAttributes<typeof Avatar, AvatarProps>;
|
39
|
+
export type AvatarAttrs = React.JSX.LibraryManagedAttributes<typeof Avatar, AvatarProps>;
|
@@ -10,6 +10,10 @@ export interface ButtonBaseProps {
|
|
10
10
|
delayed?: boolean | null | undefined;
|
11
11
|
loader?: boolean | null | undefined;
|
12
12
|
primary?: boolean | null | undefined;
|
13
|
+
success?: boolean | null | undefined;
|
14
|
+
error?: boolean | null | undefined;
|
15
|
+
secondary?: boolean | null | undefined;
|
16
|
+
ghost?: boolean | null | undefined;
|
13
17
|
short?: boolean | null | undefined;
|
14
18
|
/**
|
15
19
|
* @deprecated Use inline instead
|
@@ -45,6 +49,6 @@ export declare class Button extends PureComponent<ButtonProps> {
|
|
45
49
|
render(): import("react/jsx-runtime").JSX.Element;
|
46
50
|
}
|
47
51
|
export { Size as IconSize };
|
48
|
-
export type ContainerProps<T extends ButtonProps> = JSX.LibraryManagedAttributes<typeof Button, T>;
|
52
|
+
export type ContainerProps<T extends ButtonProps> = React.JSX.LibraryManagedAttributes<typeof Button, T>;
|
49
53
|
export type ButtonAttrs = ContainerProps<ButtonButtonProps> | ContainerProps<ButtonLinkProps>;
|
50
54
|
export default Button;
|
@@ -16,7 +16,7 @@ import 'core-js/modules/es.regexp.exec.js';
|
|
16
16
|
import 'core-js/modules/es.string.replace.js';
|
17
17
|
import '../global/memoize.js';
|
18
18
|
|
19
|
-
const _excluded = ["active", "danger", "delayed", "loader", "primary", "short", "text", "dropdown", "height", "icon", "iconSize", "iconClassName", "iconSuppressSizeWarning", "className", "children", "inline"];
|
19
|
+
const _excluded = ["active", "danger", "delayed", "loader", "primary", "success", "error", "secondary", "ghost", "short", "text", "dropdown", "height", "icon", "iconSize", "iconClassName", "iconSuppressSizeWarning", "className", "children", "inline"];
|
20
20
|
const warnText = deprecate(() => {}, 'Button: "text" prop is deprecated and will be removed in 8.0. Use inline instead.');
|
21
21
|
/**
|
22
22
|
* @name Button
|
@@ -39,6 +39,10 @@ class Button extends PureComponent {
|
|
39
39
|
delayed,
|
40
40
|
loader,
|
41
41
|
primary,
|
42
|
+
success,
|
43
|
+
error,
|
44
|
+
secondary,
|
45
|
+
ghost,
|
42
46
|
short,
|
43
47
|
text,
|
44
48
|
dropdown,
|
@@ -66,7 +70,6 @@ class Button extends PureComponent {
|
|
66
70
|
className: classNames(styles.icon, iconClassName),
|
67
71
|
glyph: icon,
|
68
72
|
size: iconSize,
|
69
|
-
loading: loader && isInline,
|
70
73
|
suppressSizeWarning: iconSuppressSizeWarning
|
71
74
|
}), children, dropdown && jsx(Icon, {
|
72
75
|
glyph: isInline ? chevron12pxDown : chevronDownIcon,
|
@@ -78,7 +81,7 @@ class Button extends PureComponent {
|
|
78
81
|
}, props), {}, {
|
79
82
|
className: classes,
|
80
83
|
children: jsxs(Fragment, {
|
81
|
-
children: [loader &&
|
84
|
+
children: [loader && jsx("div", {
|
82
85
|
className: styles.loaderBackground
|
83
86
|
}), content]
|
84
87
|
})
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import { ButtonProps } from './button';
|
2
|
-
export declare function getButtonClasses({ className, active, disabled, loader, primary, short, inline, danger, delayed, icon, height, children, }: ButtonProps): string;
|
2
|
+
export declare function getButtonClasses({ className, active, disabled, loader, primary, success, error, secondary, ghost, short, inline, danger, delayed, icon, height, children, }: ButtonProps): string;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { a as _objectWithoutProperties, b as _objectSpread2 } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/es.regexp.exec.js';
|
3
3
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
4
|
-
import { PureComponent } from 'react';
|
4
|
+
import { PureComponent, Children } from 'react';
|
5
5
|
import classNames from 'classnames';
|
6
6
|
import joinDataTestAttributes from '../global/data-tests.js';
|
7
7
|
import { ControlLabel } from '../control-label/control-label.js';
|
@@ -25,7 +25,9 @@ class ButtonGroup extends PureComponent {
|
|
25
25
|
help
|
26
26
|
} = _this$props,
|
27
27
|
restProps = _objectWithoutProperties(_this$props, _excluded);
|
28
|
-
const classes = classNames(split ? styles.split : styles.buttonGroup, className
|
28
|
+
const classes = classNames(split ? styles.split : styles.buttonGroup, className, {
|
29
|
+
[styles.disabled]: Children.toArray(this.props.children).every(child => child != null && typeof child === 'object' && 'props' in child && child.props.disabled)
|
30
|
+
});
|
29
31
|
return jsxs(Fragment, {
|
30
32
|
children: [label && jsx(ControlLabel, {
|
31
33
|
children: label
|
@@ -33,4 +33,4 @@ export default class Confirm extends PureComponent<ConfirmProps> {
|
|
33
33
|
onEscPress: () => void;
|
34
34
|
render(): import("react/jsx-runtime").JSX.Element;
|
35
35
|
}
|
36
|
-
export type ConfirmAttributes = JSX.LibraryManagedAttributes<typeof Confirm, ConfirmProps>;
|
36
|
+
export type ConfirmAttributes = React.JSX.LibraryManagedAttributes<typeof Confirm, ConfirmProps>;
|
@@ -28,6 +28,11 @@ import 'sniffr';
|
|
28
28
|
import '../tab-trap/tab-trap.js';
|
29
29
|
import '../global/dom.js';
|
30
30
|
import '../popup/popup.target.js';
|
31
|
+
import '../popup/popup.js';
|
32
|
+
import 'core-js/modules/es.string.replace.js';
|
33
|
+
import '../popup/position.js';
|
34
|
+
import 'core-js/modules/es.array.sort.js';
|
35
|
+
import '../popup/popup.consts.js';
|
31
36
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
32
37
|
import 'scrollbar-width';
|
33
38
|
import '@jetbrains/icons/chevron-down';
|
@@ -36,7 +41,6 @@ import 'util-deprecate';
|
|
36
41
|
import '../icon/icon.js';
|
37
42
|
import '../icon/icon__constants.js';
|
38
43
|
import '../_helpers/icon__svg.js';
|
39
|
-
import 'core-js/modules/es.string.replace.js';
|
40
44
|
import '../global/memoize.js';
|
41
45
|
import '../link/clickableLink.js';
|
42
46
|
import '../global/controls-height.js';
|
@@ -40,6 +40,10 @@ import '../global/memoize.js';
|
|
40
40
|
import '../link/clickableLink.js';
|
41
41
|
import '../_helpers/button__classes.js';
|
42
42
|
import '../popup/popup.target.js';
|
43
|
+
import '../popup/popup.js';
|
44
|
+
import '../popup/position.js';
|
45
|
+
import 'core-js/modules/es.array.sort.js';
|
46
|
+
import '../popup/popup.consts.js';
|
43
47
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
44
48
|
import 'scrollbar-width';
|
45
49
|
import '../panel/panel.js';
|
@@ -20,7 +20,7 @@ declare class ContentEditableBase extends Component<ContentEditableBaseProps> {
|
|
20
20
|
componentDidUpdate(prevProps: ContentEditableBaseProps): void;
|
21
21
|
render(): import("react/jsx-runtime").JSX.Element;
|
22
22
|
}
|
23
|
-
type ContentEditableBaseAttrs = JSX.LibraryManagedAttributes<typeof ContentEditableBase, ContentEditableBaseProps>;
|
23
|
+
type ContentEditableBaseAttrs = React.JSX.LibraryManagedAttributes<typeof ContentEditableBase, ContentEditableBaseProps>;
|
24
24
|
export type ContentEditableProps = Omit<ContentEditableBaseAttrs, '__html'>;
|
25
25
|
declare const ContentEditable: ({ children, ...props }: ContentEditableProps) => import("react/jsx-runtime").JSX.Element;
|
26
26
|
export default ContentEditable;
|
@@ -47,4 +47,4 @@ export default class DatePicker extends PureComponent<DatePickerProps> {
|
|
47
47
|
getAnchorText: () => string;
|
48
48
|
render(): import("react/jsx-runtime").JSX.Element;
|
49
49
|
}
|
50
|
-
export type DatePickerAttrs = JSX.LibraryManagedAttributes<typeof DatePicker, DatePickerProps>;
|
50
|
+
export type DatePickerAttrs = React.JSX.LibraryManagedAttributes<typeof DatePicker, DatePickerProps>;
|
@@ -47,4 +47,4 @@ export default class Dialog extends PureComponent<DialogProps> {
|
|
47
47
|
nativeDialog: React.RefObject<HTMLDialogElement>;
|
48
48
|
render(): false | import("react/jsx-runtime").JSX.Element;
|
49
49
|
}
|
50
|
-
export type DialogAttrs = JSX.LibraryManagedAttributes<typeof Dialog, DialogProps>;
|
50
|
+
export type DialogAttrs = React.JSX.LibraryManagedAttributes<typeof Dialog, DialogProps>;
|
@@ -11,7 +11,8 @@ import joinDataTestAttributes from '../global/data-tests.js';
|
|
11
11
|
import Shortcuts from '../shortcuts/shortcuts.js';
|
12
12
|
import TabTrap from '../tab-trap/tab-trap.js';
|
13
13
|
import { Button } from '../button/button.js';
|
14
|
-
import { PopupTarget } from '../popup/popup.target.js';
|
14
|
+
import { PopupTarget, PopupTargetContext } from '../popup/popup.target.js';
|
15
|
+
import { getPopupContainer } from '../popup/popup.js';
|
15
16
|
import { p as preventerFactory, s as styles } from '../_helpers/dialog__body-scroll-preventer.js';
|
16
17
|
import '../island/adaptive-island-hoc.js';
|
17
18
|
import '../global/linear-function.js';
|
@@ -37,6 +38,9 @@ import '../global/memoize.js';
|
|
37
38
|
import '../link/clickableLink.js';
|
38
39
|
import '../global/controls-height.js';
|
39
40
|
import '../_helpers/button__classes.js';
|
41
|
+
import '../popup/position.js';
|
42
|
+
import 'core-js/modules/es.array.sort.js';
|
43
|
+
import '../popup/popup.consts.js';
|
40
44
|
import 'scrollbar-width';
|
41
45
|
|
42
46
|
const _excluded = ["show", "showCloseButton", "onOverlayClick", "onCloseAttempt", "onEscPress", "onCloseClick", "children", "className", "contentClassName", "trapFocus", "data-test", "closeButtonInside", "portalTarget", "label", "closeButtonTitle", "dense", "shortcutOptions", "native", "modal", "preventBodyScroll"];
|
@@ -208,19 +212,32 @@ class Dialog extends PureComponent {
|
|
208
212
|
})
|
209
213
|
});
|
210
214
|
}
|
211
|
-
return show &&
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
215
|
+
return show && jsx(PopupTargetContext.Consumer, {
|
216
|
+
children: contextTarget => {
|
217
|
+
let targetElement = document.body;
|
218
|
+
if (portalTarget instanceof HTMLElement) {
|
219
|
+
targetElement = portalTarget;
|
220
|
+
} else if (contextTarget != null) {
|
221
|
+
const container = getPopupContainer(contextTarget);
|
222
|
+
if (container != null) {
|
223
|
+
targetElement = container;
|
224
|
+
}
|
225
|
+
}
|
226
|
+
return /*#__PURE__*/createPortal(jsx(PopupTarget, {
|
227
|
+
id: this.uid,
|
228
|
+
className: styles.popupTarget,
|
229
|
+
children: target => jsxs(TabTrap, _objectSpread2(_objectSpread2({
|
230
|
+
trapDisabled: !trapFocus,
|
231
|
+
"data-test": joinDataTestAttributes('ring-dialog-container', dataTest),
|
232
|
+
ref: this.dialogRef,
|
233
|
+
className: classes,
|
234
|
+
role: "presentation"
|
235
|
+
}, restProps), {}, {
|
236
|
+
children: [content, target]
|
237
|
+
}))
|
238
|
+
}), targetElement);
|
239
|
+
}
|
240
|
+
});
|
224
241
|
}
|
225
242
|
}
|
226
243
|
_defineProperty(Dialog, "defaultProps", {
|
@@ -13,13 +13,15 @@ export interface DropdownChildProps {
|
|
13
13
|
onContextMenu?: () => void | undefined;
|
14
14
|
dontCloseOnAnchorClick: boolean;
|
15
15
|
}
|
16
|
+
export type DropdownChildrenFunction = (props: Omit<PopupAttrs, 'children'>) => ReactNode;
|
17
|
+
export type DropdownChildren = ReactElement<PopupAttrs> | DropdownChildrenFunction;
|
16
18
|
export interface DropdownProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
|
17
19
|
/**
|
18
20
|
* Can be string, React element, or a function accepting an object with {active, pinned} properties and returning a React element
|
19
21
|
* React element should render some interactive HTML element like `button` or `a`
|
20
22
|
*/
|
21
23
|
anchor: ReactElement | readonly ReactElement[] | string | ((props: AnchorProps) => ReactNode);
|
22
|
-
children:
|
24
|
+
children: DropdownChildren;
|
23
25
|
initShown: boolean;
|
24
26
|
disabled?: boolean | null | undefined;
|
25
27
|
clickMode: boolean;
|
@@ -66,5 +68,5 @@ export default class Dropdown extends Component<DropdownProps, DropdownState> {
|
|
66
68
|
_clearTimer(): void;
|
67
69
|
render(): import("react/jsx-runtime").JSX.Element;
|
68
70
|
}
|
69
|
-
export type DropdownAttrs = JSX.LibraryManagedAttributes<typeof Dropdown, DropdownProps>;
|
71
|
+
export type DropdownAttrs = React.JSX.LibraryManagedAttributes<typeof Dropdown, DropdownProps>;
|
70
72
|
export { Anchor };
|
@@ -1,19 +1,21 @@
|
|
1
|
-
import { ReactElement,
|
1
|
+
import { ReactElement, HTMLAttributes, SyntheticEvent, Ref, ReactNode } from 'react';
|
2
2
|
import { SelectHandlerParams } from '../list/list';
|
3
|
-
import { AnchorProps, DropdownAttrs } from '../dropdown/dropdown';
|
3
|
+
import { AnchorProps, DropdownAttrs, DropdownChildrenFunction } from '../dropdown/dropdown';
|
4
4
|
import PopupMenu, { PopupMenuAttrs } from '../popup-menu/popup-menu';
|
5
5
|
import { ListDataItem } from '../list/consts';
|
6
6
|
export interface DropdownAnchorWrapperProps extends AnchorProps {
|
7
|
-
anchor: ReactElement |
|
7
|
+
anchor: ReactElement | ReactNode[] | string | ((props: AnchorProps, ariaProps: HTMLAttributes<HTMLElement>) => ReactElement | null);
|
8
8
|
activeListItemId?: string | null | undefined;
|
9
9
|
listId?: string | undefined;
|
10
10
|
}
|
11
|
+
type OnSelectHandler<T> = ((item: ListDataItem<T>, event: Event | SyntheticEvent, params?: SelectHandlerParams) => void) | undefined;
|
11
12
|
export interface DropdownMenuProps<T = unknown> extends Omit<DropdownAttrs, 'anchor' | 'onSelect' | 'children'> {
|
12
|
-
anchor: ReactElement |
|
13
|
+
anchor: ReactElement | ReactNode[] | string | ((props: AnchorProps, ariaProps: HTMLAttributes<HTMLElement>) => ReactElement | null);
|
13
14
|
data?: readonly ListDataItem<T>[] | undefined;
|
14
15
|
ariaLabel?: string | null | undefined;
|
15
|
-
onSelect?:
|
16
|
+
onSelect?: OnSelectHandler<T>;
|
16
17
|
menuProps?: PopupMenuAttrs<T> | null | undefined;
|
18
|
+
children?: DropdownChildrenFunction;
|
17
19
|
}
|
18
20
|
declare const _default: (<T = unknown>(props: DropdownMenuProps<T> & {
|
19
21
|
ref?: Ref<PopupMenu>;
|
@@ -65,7 +65,7 @@ import '../popup/popup.consts.js';
|
|
65
65
|
import '../popup/popup.target.js';
|
66
66
|
|
67
67
|
const _excluded = ["anchor", "pinned", "active", "activeListItemId", "listId"],
|
68
|
-
_excluded2 = ["id", "anchor", "ariaLabel", "data", "onSelect", "menuProps"],
|
68
|
+
_excluded2 = ["id", "anchor", "ariaLabel", "data", "onSelect", "menuProps", "children"],
|
69
69
|
_excluded3 = ["pinned", "active"];
|
70
70
|
const defaultAriaLabel = 'Dropdown menu';
|
71
71
|
function DropdownAnchorWrapper(_ref) {
|
@@ -110,25 +110,45 @@ function DropdownAnchorWrapper(_ref) {
|
|
110
110
|
children: anchor
|
111
111
|
}));
|
112
112
|
}
|
113
|
-
|
113
|
+
function renderDropdownMenuChildren(_ref2) {
|
114
|
+
let {
|
115
|
+
children,
|
116
|
+
popupMenuProps
|
117
|
+
} = _ref2;
|
118
|
+
if (!children) {
|
119
|
+
return jsx(PopupMenu, _objectSpread2({}, popupMenuProps));
|
120
|
+
}
|
121
|
+
return popupProps => children(_objectSpread2(_objectSpread2({}, popupProps), popupMenuProps));
|
122
|
+
}
|
123
|
+
const DropdownMenu = /*#__PURE__*/forwardRef(function DropdownMenu(_ref3, forwardedRef) {
|
114
124
|
let {
|
115
125
|
id,
|
116
126
|
anchor,
|
117
127
|
ariaLabel,
|
118
128
|
data,
|
119
129
|
onSelect,
|
120
|
-
menuProps
|
121
|
-
|
122
|
-
|
130
|
+
menuProps,
|
131
|
+
children
|
132
|
+
} = _ref3,
|
133
|
+
restDropdownProps = _objectWithoutProperties(_ref3, _excluded2);
|
123
134
|
const listId = useMemo(() => id || getUID('dropdown-menu-list'), [id]);
|
135
|
+
const popupMenuProps = useMemo(() => _objectSpread2({
|
136
|
+
ref: forwardedRef,
|
137
|
+
id: listId,
|
138
|
+
ariaLabel: ariaLabel || defaultAriaLabel,
|
139
|
+
closeOnSelect: true,
|
140
|
+
activateFirstItem: true,
|
141
|
+
data,
|
142
|
+
onSelect
|
143
|
+
}, menuProps), [ariaLabel, data, forwardedRef, listId, menuProps, onSelect]);
|
124
144
|
return jsx(ActiveItemContext.Provider, {
|
125
145
|
children: jsx(Dropdown, _objectSpread2(_objectSpread2({
|
126
|
-
anchor:
|
146
|
+
anchor: _ref4 => {
|
127
147
|
let {
|
128
148
|
pinned,
|
129
149
|
active
|
130
|
-
} =
|
131
|
-
restAnchorProps = _objectWithoutProperties(
|
150
|
+
} = _ref4,
|
151
|
+
restAnchorProps = _objectWithoutProperties(_ref4, _excluded3);
|
132
152
|
return jsx(ActiveItemContext.ValueContext.Consumer, {
|
133
153
|
children: activeItemId => jsx(DropdownAnchorWrapper, _objectSpread2({
|
134
154
|
anchor: anchor,
|
@@ -140,15 +160,10 @@ const DropdownMenu = /*#__PURE__*/forwardRef(function DropdownMenu(_ref2, forwar
|
|
140
160
|
});
|
141
161
|
}
|
142
162
|
}, restDropdownProps), {}, {
|
143
|
-
children:
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
closeOnSelect: true,
|
148
|
-
activateFirstItem: true,
|
149
|
-
data: data,
|
150
|
-
onSelect: onSelect
|
151
|
-
}, menuProps))
|
163
|
+
children: renderDropdownMenuChildren({
|
164
|
+
children,
|
165
|
+
popupMenuProps
|
166
|
+
})
|
152
167
|
}))
|
153
168
|
});
|
154
169
|
});
|
@@ -14,6 +14,6 @@ export interface FocusSensorAddProps<T extends HTMLElement> {
|
|
14
14
|
onFocusRestore: () => void;
|
15
15
|
}
|
16
16
|
type RestProps<P, T extends HTMLElement> = Omit<P, keyof FocusSensorAddProps<T>>;
|
17
|
-
export type FocusSensorProps<P extends FocusSensorAddProps<T>, T extends HTMLElement, C extends ComponentType<P>> = RestProps<JSX.LibraryManagedAttributes<C, P>, T> & FocusSensorOuterProps<T>;
|
17
|
+
export type FocusSensorProps<P extends FocusSensorAddProps<T>, T extends HTMLElement, C extends ComponentType<P>> = RestProps<React.JSX.LibraryManagedAttributes<C, P>, T> & FocusSensorOuterProps<T>;
|
18
18
|
export default function focusSensorHOC<T extends HTMLElement, P extends FocusSensorAddProps<T>, C extends ComponentType<P>>(ComposedComponent: C): ComponentType<FocusSensorProps<P, T, typeof ComposedComponent>>;
|
19
19
|
export {};
|
@@ -19,7 +19,7 @@ declare class Header extends Component<HeaderProps> {
|
|
19
19
|
};
|
20
20
|
render(): import("react/jsx-runtime").JSX.Element;
|
21
21
|
}
|
22
|
-
export type HeaderAttrs = JSX.LibraryManagedAttributes<typeof Header, HeaderProps>;
|
22
|
+
export type HeaderAttrs = React.JSX.LibraryManagedAttributes<typeof Header, HeaderProps>;
|
23
23
|
export default Header;
|
24
24
|
export { default as Logo } from './logo';
|
25
25
|
export { default as Tray } from './tray';
|
@@ -13,7 +13,7 @@ export interface ProfileTranslations {
|
|
13
13
|
logout?: string | null | undefined;
|
14
14
|
certificateMismatch?: string | null | undefined;
|
15
15
|
}
|
16
|
-
export interface ProfileProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
16
|
+
export interface ProfileProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect' | 'children'> {
|
17
17
|
closeOnSelect: boolean;
|
18
18
|
renderPopupItems: (items: ListDataItem[]) => readonly ListDataItem[];
|
19
19
|
translations?: ProfileTranslations | null | undefined;
|
@@ -46,4 +46,4 @@ export default class Profile extends PureComponent<ProfileProps> {
|
|
46
46
|
static Size: typeof Size;
|
47
47
|
render(): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
|
48
48
|
}
|
49
|
-
export type ProfileAttrs = JSX.LibraryManagedAttributes<typeof Profile, ProfileProps>;
|
49
|
+
export type ProfileAttrs = React.JSX.LibraryManagedAttributes<typeof Profile, ProfileProps>;
|
@@ -28,5 +28,5 @@ export default class Icon extends PureComponent<IconProps> {
|
|
28
28
|
} | undefined;
|
29
29
|
render(): import("react/jsx-runtime").JSX.Element | null;
|
30
30
|
}
|
31
|
-
export type IconAttrs = JSX.LibraryManagedAttributes<typeof Icon, IconProps>;
|
31
|
+
export type IconAttrs = React.JSX.LibraryManagedAttributes<typeof Icon, IconProps>;
|
32
32
|
export { Color, Size };
|
@@ -70,7 +70,7 @@ export declare class Input extends PureComponent<InputProps> {
|
|
70
70
|
handleTextareaChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
71
71
|
render(): import("react/jsx-runtime").JSX.Element;
|
72
72
|
}
|
73
|
-
export type ContainerProps<P extends InputProps> = JSX.LibraryManagedAttributes<typeof Input, P>;
|
73
|
+
export type ContainerProps<P extends InputProps> = React.JSX.LibraryManagedAttributes<typeof Input, P>;
|
74
74
|
export type InputSpecificAttrs = ContainerProps<InputSpecificProps>;
|
75
75
|
export type TextAreaSpecificAttrs = ContainerProps<TextAreaSpecificProps>;
|
76
76
|
export type InputAttrs = InputSpecificAttrs | TextAreaSpecificAttrs;
|
@@ -166,4 +166,4 @@ export default class List<T = unknown> extends Component<ListProps<T>, ListState
|
|
166
166
|
/** @override */
|
167
167
|
render(): import("react/jsx-runtime").JSX.Element;
|
168
168
|
}
|
169
|
-
export type ListAttrs<T = unknown> = JSX.LibraryManagedAttributes<typeof List, ListProps<T>>;
|
169
|
+
export type ListAttrs<T = unknown> = React.JSX.LibraryManagedAttributes<typeof List, ListProps<T>>;
|
@@ -8,5 +8,5 @@ export interface LoaderInlineProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
8
|
declare class LoaderInline extends PureComponent<LoaderInlineProps> {
|
9
9
|
render(): import("react/jsx-runtime").JSX.Element;
|
10
10
|
}
|
11
|
-
export type LoaderInlineAtrrs = JSX.LibraryManagedAttributes<typeof LoaderInline, LoaderInlineProps>;
|
11
|
+
export type LoaderInlineAtrrs = React.JSX.LibraryManagedAttributes<typeof LoaderInline, LoaderInlineProps>;
|
12
12
|
export default LoaderInline;
|
@@ -33,4 +33,4 @@ export default class LoginDialog extends Component<LoginDialogProps> {
|
|
33
33
|
onMessage: (event: MessageEvent) => void;
|
34
34
|
render(): import("react/jsx-runtime").JSX.Element;
|
35
35
|
}
|
36
|
-
export type LoginDialogAttrs = JSX.LibraryManagedAttributes<typeof LoginDialog, LoginDialogProps>;
|
36
|
+
export type LoginDialogAttrs = React.JSX.LibraryManagedAttributes<typeof LoginDialog, LoginDialogProps>;
|
@@ -39,6 +39,10 @@ import '../link/clickableLink.js';
|
|
39
39
|
import '../global/controls-height.js';
|
40
40
|
import '../_helpers/button__classes.js';
|
41
41
|
import '../popup/popup.target.js';
|
42
|
+
import '../popup/popup.js';
|
43
|
+
import '../popup/position.js';
|
44
|
+
import 'core-js/modules/es.array.sort.js';
|
45
|
+
import '../popup/popup.consts.js';
|
42
46
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
43
47
|
import 'scrollbar-width';
|
44
48
|
import '../loader/loader.js';
|
@@ -39,6 +39,10 @@ import '../global/memoize.js';
|
|
39
39
|
import '../link/clickableLink.js';
|
40
40
|
import '../_helpers/button__classes.js';
|
41
41
|
import '../popup/popup.target.js';
|
42
|
+
import '../popup/popup.js';
|
43
|
+
import '../popup/position.js';
|
44
|
+
import 'core-js/modules/es.array.sort.js';
|
45
|
+
import '../popup/popup.consts.js';
|
42
46
|
import '../_helpers/dialog__body-scroll-preventer.js';
|
43
47
|
import 'scrollbar-width';
|
44
48
|
import '../loader-screen/loader-screen.js';
|
@@ -51,5 +51,5 @@ export default class Message extends Component<MessageProps> {
|
|
51
51
|
getTailOffset(): number;
|
52
52
|
render(): import("react/jsx-runtime").JSX.Element;
|
53
53
|
}
|
54
|
-
export type MessageAttrs = JSX.LibraryManagedAttributes<typeof Message, MessageProps>;
|
54
|
+
export type MessageAttrs = React.JSX.LibraryManagedAttributes<typeof Message, MessageProps>;
|
55
55
|
export {};
|
@@ -76,5 +76,5 @@ export default class Pager extends PureComponent<PagerProps> {
|
|
76
76
|
getPagerContent(): import("react/jsx-runtime").JSX.Element;
|
77
77
|
render(): import("react/jsx-runtime").JSX.Element;
|
78
78
|
}
|
79
|
-
export type PagerAttrs = JSX.LibraryManagedAttributes<typeof Pager, PagerProps>;
|
79
|
+
export type PagerAttrs = React.JSX.LibraryManagedAttributes<typeof Pager, PagerProps>;
|
80
80
|
export {};
|
@@ -145,5 +145,5 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
|
|
145
145
|
};
|
146
146
|
render(): import("react/jsx-runtime").JSX.Element;
|
147
147
|
}
|
148
|
-
export type PopupAttrs = JSX.LibraryManagedAttributes<typeof Popup, PopupProps>;
|
149
|
-
export type BasePopupAttrs = JSX.LibraryManagedAttributes<typeof Popup, BasePopupProps>;
|
148
|
+
export type PopupAttrs = React.JSX.LibraryManagedAttributes<typeof Popup, PopupProps>;
|
149
|
+
export type BasePopupAttrs = React.JSX.LibraryManagedAttributes<typeof Popup, BasePopupProps>;
|