@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.
Files changed (66) hide show
  1. package/README.md +7 -8
  2. package/components/_helpers/button__classes.js +10 -3
  3. package/components/_helpers/caption.js +1 -1
  4. package/components/_helpers/dialog__body-scroll-preventer.js +1 -1
  5. package/components/auth-dialog-service/auth-dialog-service.d.ts +1 -1
  6. package/components/avatar/avatar.d.ts +1 -1
  7. package/components/button/button.d.ts +5 -1
  8. package/components/button/button.js +6 -3
  9. package/components/button/button__classes.d.ts +1 -1
  10. package/components/button-group/button-group.js +4 -2
  11. package/components/confirm/confirm.d.ts +1 -1
  12. package/components/contenteditable/contenteditable.d.ts +1 -1
  13. package/components/date-picker/date-picker.d.ts +1 -1
  14. package/components/dialog/dialog.d.ts +1 -1
  15. package/components/dropdown/dropdown.d.ts +4 -2
  16. package/components/dropdown-menu/dropdown-menu.d.ts +7 -5
  17. package/components/dropdown-menu/dropdown-menu.js +33 -17
  18. package/components/global/focus-sensor-hoc.d.ts +1 -1
  19. package/components/global/focus-sensor-hoc.js +3 -1
  20. package/components/header/header.d.ts +1 -1
  21. package/components/header/header.js +1 -0
  22. package/components/header/profile.d.ts +2 -2
  23. package/components/header/profile.js +1 -0
  24. package/components/header/smart-profile.js +1 -0
  25. package/components/icon/icon.d.ts +1 -1
  26. package/components/input/input.d.ts +1 -1
  27. package/components/list/list.d.ts +1 -1
  28. package/components/list/list.js +2 -0
  29. package/components/list/list__users-groups-source.js +1 -0
  30. package/components/loader-inline/loader-inline.d.ts +1 -1
  31. package/components/login-dialog/login-dialog.d.ts +1 -1
  32. package/components/message/message.d.ts +1 -1
  33. package/components/pager/pager.d.ts +1 -1
  34. package/components/popup/popup.d.ts +3 -2
  35. package/components/popup/popup.js +5 -7
  36. package/components/popup-menu/popup-menu.d.ts +1 -1
  37. package/components/popup-menu/popup-menu.js +1 -0
  38. package/components/progress-bar/progress-bar.d.ts +1 -1
  39. package/components/query-assist/query-assist.d.ts +1 -1
  40. package/components/query-assist/query-assist.js +1 -0
  41. package/components/query-assist/query-assist__suggestions.js +1 -0
  42. package/components/select/select.d.ts +3 -3
  43. package/components/select/select__filter.js +1 -0
  44. package/components/select/select__popup.d.ts +1 -1
  45. package/components/select/select__popup.js +1 -0
  46. package/components/style.css +1 -1
  47. package/components/table/header.d.ts +1 -1
  48. package/components/table/row.d.ts +1 -1
  49. package/components/tabs/collapsible-more.js +1 -0
  50. package/components/tabs/collapsible-tabs.js +1 -0
  51. package/components/tabs/dumb-tabs.d.ts +2 -1
  52. package/components/tabs/dumb-tabs.js +1 -0
  53. package/components/tabs/smart-tabs.js +1 -0
  54. package/components/tabs/tabs.js +1 -0
  55. package/components/tag/tag.d.ts +1 -1
  56. package/components/tag/tag.js +1 -1
  57. package/components/tags-input/tags-input.d.ts +1 -1
  58. package/components/tags-list/tags-list.d.ts +1 -1
  59. package/components/toggle/toggle.d.ts +1 -1
  60. package/components/tooltip/tooltip.d.ts +1 -1
  61. package/components/upload/upload.d.ts +19 -0
  62. package/components/upload/upload.js +88 -0
  63. package/components/user-agreement/user-agreement.d.ts +1 -1
  64. package/components/user-card/card.d.ts +1 -1
  65. package/components/user-card/tooltip.d.ts +1 -1
  66. package/package.json +12 -4
package/README.md CHANGED
@@ -3,6 +3,13 @@
3
3
 
4
4
  [![official JetBrains project](https://jb.gg/badges/official-flat-square.svg)](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","disabled":"disabled_rui_0b90","primaryBlock":"primaryBlock_rui_0b90","loader":"loader_rui_0b90","loaderBackground":"loaderBackground_rui_0b90","iconOnly":"iconOnly_rui_0b90","text-loading":"text-loading_rui_0b90","progress":"progress_rui_0b90","delayed":"delayed_rui_0b90","short":"short_rui_0b90","dropdownIcon":"dropdownIcon_rui_0b90","primary":"primary_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 = icon && !active && !danger && !primary && !disabled && (!inline || iconOnly);
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","primary":"primary_rui_0b90","buttonGroup":"buttonGroup_rui_bbca common_rui_bbca buttonGroup_rui_f4fc","common":"common_rui_bbca","split":"split_rui_bbca common_rui_bbca buttonGroup_rui_f4fc","caption":"caption_rui_bbca font_rui_8bff","help":"help_rui_bbca"};
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","closeIconInside":"closeIconInside_rui_381e","closeButton":"closeButton_rui_381e","closeIcon":"closeIcon_rui_381e","closeButtonOutside":"closeButtonOutside_rui_381e","closeButtonInside":"closeButtonInside_rui_381e","documentWithoutScroll":"documentWithoutScroll_rui_381e","popupTarget":"popupTarget_rui_381e","dense":"dense_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;
@@ -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 {};
@@ -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 && !isInline && jsx("div", {
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>;
@@ -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>;
@@ -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: ReactElement<PopupAttrs> | ((props: Omit<PopupAttrs, 'children'>) => ReactNode);
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, ReactNodeArray, HTMLAttributes, SyntheticEvent, Ref } from 'react';
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 | ReactNodeArray | string | ((props: AnchorProps, ariaProps: HTMLAttributes<HTMLElement>) => ReactElement | null);
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 | ReactNodeArray | string | ((props: AnchorProps, ariaProps: HTMLAttributes<HTMLElement>) => ReactElement | null);
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?: ((item: ListDataItem<T>, event: Event | SyntheticEvent, params?: SelectHandlerParams) => void) | undefined;
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>;
@@ -8,6 +8,7 @@ import getUID from '../global/get-uid.js';
8
8
  import { A as Anchor } from '../_helpers/anchor.js';
9
9
  import { isArray } from '../global/typescript-utils.js';
10
10
  import 'core-js/modules/es.symbol.description.js';
11
+ import 'core-js/modules/es.string.trim.js';
11
12
  import 'core-js/modules/web.dom-collections.iterator.js';
12
13
  import 'classnames';
13
14
  import 'react-virtualized/dist/es/List';
@@ -65,7 +66,7 @@ import '../popup/popup.consts.js';
65
66
  import '../popup/popup.target.js';
66
67
 
67
68
  const _excluded = ["anchor", "pinned", "active", "activeListItemId", "listId"],
68
- _excluded2 = ["id", "anchor", "ariaLabel", "data", "onSelect", "menuProps"],
69
+ _excluded2 = ["id", "anchor", "ariaLabel", "data", "onSelect", "menuProps", "children"],
69
70
  _excluded3 = ["pinned", "active"];
70
71
  const defaultAriaLabel = 'Dropdown menu';
71
72
  function DropdownAnchorWrapper(_ref) {
@@ -110,25 +111,45 @@ function DropdownAnchorWrapper(_ref) {
110
111
  children: anchor
111
112
  }));
112
113
  }
113
- const DropdownMenu = /*#__PURE__*/forwardRef(function DropdownMenu(_ref2, forwardedRef) {
114
+ function renderDropdownMenuChildren(_ref2) {
115
+ let {
116
+ children,
117
+ popupMenuProps
118
+ } = _ref2;
119
+ if (!children) {
120
+ return jsx(PopupMenu, _objectSpread2({}, popupMenuProps));
121
+ }
122
+ return popupProps => children(_objectSpread2(_objectSpread2({}, popupProps), popupMenuProps));
123
+ }
124
+ const DropdownMenu = /*#__PURE__*/forwardRef(function DropdownMenu(_ref3, forwardedRef) {
114
125
  let {
115
126
  id,
116
127
  anchor,
117
128
  ariaLabel,
118
129
  data,
119
130
  onSelect,
120
- menuProps
121
- } = _ref2,
122
- restDropdownProps = _objectWithoutProperties(_ref2, _excluded2);
131
+ menuProps,
132
+ children
133
+ } = _ref3,
134
+ restDropdownProps = _objectWithoutProperties(_ref3, _excluded2);
123
135
  const listId = useMemo(() => id || getUID('dropdown-menu-list'), [id]);
136
+ const popupMenuProps = useMemo(() => _objectSpread2({
137
+ ref: forwardedRef,
138
+ id: listId,
139
+ ariaLabel: ariaLabel || defaultAriaLabel,
140
+ closeOnSelect: true,
141
+ activateFirstItem: true,
142
+ data,
143
+ onSelect
144
+ }, menuProps), [ariaLabel, data, forwardedRef, listId, menuProps, onSelect]);
124
145
  return jsx(ActiveItemContext.Provider, {
125
146
  children: jsx(Dropdown, _objectSpread2(_objectSpread2({
126
- anchor: _ref3 => {
147
+ anchor: _ref4 => {
127
148
  let {
128
149
  pinned,
129
150
  active
130
- } = _ref3,
131
- restAnchorProps = _objectWithoutProperties(_ref3, _excluded3);
151
+ } = _ref4,
152
+ restAnchorProps = _objectWithoutProperties(_ref4, _excluded3);
132
153
  return jsx(ActiveItemContext.ValueContext.Consumer, {
133
154
  children: activeItemId => jsx(DropdownAnchorWrapper, _objectSpread2({
134
155
  anchor: anchor,
@@ -140,15 +161,10 @@ const DropdownMenu = /*#__PURE__*/forwardRef(function DropdownMenu(_ref2, forwar
140
161
  });
141
162
  }
142
163
  }, restDropdownProps), {}, {
143
- children: jsx(PopupMenu, _objectSpread2({
144
- ref: forwardedRef,
145
- id: listId,
146
- ariaLabel: ariaLabel || defaultAriaLabel,
147
- closeOnSelect: true,
148
- activateFirstItem: true,
149
- data: data,
150
- onSelect: onSelect
151
- }, menuProps))
164
+ children: renderDropdownMenuChildren({
165
+ children,
166
+ popupMenuProps
167
+ })
152
168
  }))
153
169
  });
154
170
  });
@@ -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 {};
@@ -95,10 +95,12 @@ function focusSensorHOC(ComposedComponent) {
95
95
  }
96
96
  }
97
97
  componentDidUpdate(prevProps) {
98
+ var _this$node4;
98
99
  const {
99
100
  focused
100
101
  } = this.props;
101
- if (focused && !prevProps.focused) {
102
+ const isInFocus = (_this$node4 = this.node) === null || _this$node4 === void 0 ? void 0 : _this$node4.contains(document.activeElement);
103
+ if (focused && (!isInFocus || !prevProps.focused)) {
102
104
  this.onFocusRestore();
103
105
  } else if (!focused && prevProps.focused) {
104
106
  this.onFocusReset();
@@ -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';
@@ -47,6 +47,7 @@ import '../avatar/fallback-avatar.js';
47
47
  import '../dropdown-menu/dropdown-menu.js';
48
48
  import '../list/list.js';
49
49
  import 'core-js/modules/es.symbol.description.js';
50
+ import 'core-js/modules/es.string.trim.js';
50
51
  import 'react-virtualized/dist/es/List';
51
52
  import 'react-virtualized/dist/es/AutoSizer';
52
53
  import 'react-virtualized/dist/es/WindowScroller';
@@ -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,6 +28,7 @@ import '../global/controls-height.js';
28
28
  import '../_helpers/button__classes.js';
29
29
  import '../list/list.js';
30
30
  import 'core-js/modules/es.symbol.description.js';
31
+ import 'core-js/modules/es.string.trim.js';
31
32
  import 'react-virtualized/dist/es/List';
32
33
  import 'react-virtualized/dist/es/AutoSizer';
33
34
  import 'react-virtualized/dist/es/WindowScroller';
@@ -58,6 +58,7 @@ import '../avatar/fallback-avatar.js';
58
58
  import '../dropdown-menu/dropdown-menu.js';
59
59
  import '../list/list.js';
60
60
  import 'core-js/modules/es.symbol.description.js';
61
+ import 'core-js/modules/es.string.trim.js';
61
62
  import 'react-virtualized/dist/es/List';
62
63
  import 'react-virtualized/dist/es/AutoSizer';
63
64
  import 'react-virtualized/dist/es/WindowScroller';
@@ -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>>;
@@ -1,5 +1,6 @@
1
1
  import { _ as _defineProperty, b as _objectSpread2, a as _objectWithoutProperties } from '../_helpers/_rollupPluginBabelHelpers.js';
2
2
  import 'core-js/modules/es.symbol.description.js';
3
+ import 'core-js/modules/es.string.trim.js';
3
4
  import 'core-js/modules/web.dom-collections.iterator.js';
4
5
  import { Component, createElement } from 'react';
5
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -284,6 +285,7 @@ class List extends Component {
284
285
  if (cleanedProps.href) {
285
286
  cleanedProps.rgItemType = Type.LINK;
286
287
  }
288
+ cleanedProps.description = typeof cleanedProps.description === 'string' ? cleanedProps.description.trim() : cleanedProps.description;
287
289
  const itemProps = Object.assign({
288
290
  rgItemType: DEFAULT_ITEM_TYPE
289
291
  }, restProps);
@@ -5,6 +5,7 @@ import HubSourceUsersGroups from '../hub-source/hub-source__users-groups.js';
5
5
  import List from './list.js';
6
6
  import '../hub-source/hub-source.js';
7
7
  import 'core-js/modules/es.symbol.description.js';
8
+ import 'core-js/modules/es.string.trim.js';
8
9
  import 'react';
9
10
  import 'react/jsx-runtime';
10
11
  import 'classnames';
@@ -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>;
@@ -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 {};
@@ -121,6 +121,7 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
121
121
  private _redraw;
122
122
  private _getAnchor;
123
123
  private _listenersEnabled?;
124
+ private _prevTimeout?;
124
125
  /**
125
126
  * @param {boolean} enable
126
127
  * @private
@@ -145,5 +146,5 @@ export default class Popup<P extends BasePopupProps = PopupProps> extends PureCo
145
146
  };
146
147
  render(): import("react/jsx-runtime").JSX.Element;
147
148
  }
148
- export type PopupAttrs = JSX.LibraryManagedAttributes<typeof Popup, PopupProps>;
149
- export type BasePopupAttrs = JSX.LibraryManagedAttributes<typeof Popup, BasePopupProps>;
149
+ export type PopupAttrs = React.JSX.LibraryManagedAttributes<typeof Popup, PopupProps>;
150
+ export type BasePopupAttrs = React.JSX.LibraryManagedAttributes<typeof Popup, BasePopupProps>;
@@ -132,6 +132,7 @@ class Popup extends PureComponent {
132
132
  }
133
133
  });
134
134
  _defineProperty(this, "_listenersEnabled", void 0);
135
+ _defineProperty(this, "_prevTimeout", void 0);
135
136
  _defineProperty(this, "_onEscPress", evt => {
136
137
  this.props.onEscPress(evt);
137
138
  this._onCloseAttempt(evt, true);
@@ -154,11 +155,6 @@ class Popup extends PureComponent {
154
155
  });
155
156
  }
156
157
  componentDidMount() {
157
- if (!this.props.client) {
158
- this.setState({
159
- client: true
160
- });
161
- }
162
158
  if (!this.props.hidden) {
163
159
  this._setListenersEnabled(true);
164
160
  }
@@ -228,7 +224,8 @@ class Popup extends PureComponent {
228
224
  */
229
225
  _setListenersEnabled(enable) {
230
226
  if (enable && !this._listenersEnabled) {
231
- setTimeout(() => {
227
+ clearTimeout(this._prevTimeout);
228
+ this._prevTimeout = window.setTimeout(() => {
232
229
  this._listenersEnabled = true;
233
230
  this.listeners.add(window, 'resize', this._redraw);
234
231
  if (this.props.autoPositioningOnScroll) {
@@ -245,6 +242,7 @@ class Popup extends PureComponent {
245
242
  }
246
243
  if (!enable && this._listenersEnabled) {
247
244
  this.listeners.removeAll();
245
+ clearTimeout(this._prevTimeout);
248
246
  this._listenersEnabled = false;
249
247
  }
250
248
  }
@@ -306,7 +304,7 @@ class Popup extends PureComponent {
306
304
  children: [this.shouldUseShortcuts() && jsx(Shortcuts, {
307
305
  map: this.shortcutsMap,
308
306
  scope: this.shortcutsScope
309
- }), (client || this.state.client) && (keepMounted || !hidden) && /*#__PURE__*/createPortal(jsx(PopupTarget, {
307
+ }), client !== false && (keepMounted || !hidden) && /*#__PURE__*/createPortal(jsx(PopupTarget, {
310
308
  id: this.uid,
311
309
  ref: this.containerRef,
312
310
  onMouseOver: onMouseOver,
@@ -64,7 +64,7 @@ export default class PopupMenu<T = unknown> extends Popup<PopupMenuProps<T>> {
64
64
  /** @override */
65
65
  getInternalContent(): import("react/jsx-runtime").JSX.Element;
66
66
  }
67
- export type PopupMenuAttrs<T = unknown> = JSX.LibraryManagedAttributes<typeof PopupMenu, PopupMenuProps<T>>;
67
+ export type PopupMenuAttrs<T = unknown> = React.JSX.LibraryManagedAttributes<typeof PopupMenu, PopupMenuProps<T>>;
68
68
  export declare const ListProps: {
69
69
  Type: typeof import("../list/consts").Type;
70
70
  Dimension: {
@@ -23,6 +23,7 @@ import 'core-js/modules/es.array.sort.js';
23
23
  import '../popup/popup.consts.js';
24
24
  import '../popup/popup.target.js';
25
25
  import 'core-js/modules/es.symbol.description.js';
26
+ import 'core-js/modules/es.string.trim.js';
26
27
  import 'react-virtualized/dist/es/List';
27
28
  import 'react-virtualized/dist/es/AutoSizer';
28
29
  import 'react-virtualized/dist/es/WindowScroller';
@@ -47,4 +47,4 @@ export default class ProgressBar extends PureComponent<ProgressBarProps> {
47
47
  progressbarRef: (el: HTMLElement | null) => void;
48
48
  render(): import("react/jsx-runtime").JSX.Element;
49
49
  }
50
- export type ProgressBarAttrs = JSX.LibraryManagedAttributes<typeof ProgressBar, ProgressBarProps>;
50
+ export type ProgressBarAttrs = React.JSX.LibraryManagedAttributes<typeof ProgressBar, ProgressBarProps>;