@plesk/ui-library 3.42.0 → 3.43.0

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 (69) hide show
  1. package/cjs/components/CodeEditor/CodeEditor.js +1 -2
  2. package/cjs/components/Icon/constants.js +0 -1
  3. package/cjs/components/List/List.js +6 -3
  4. package/cjs/components/Tabs/FakeTabs.js +58 -0
  5. package/cjs/components/Tabs/Tab.js +0 -1
  6. package/cjs/components/Tabs/TabClose.js +35 -0
  7. package/cjs/components/Tabs/TabIcon.js +22 -0
  8. package/cjs/components/Tabs/TabLabel.js +34 -0
  9. package/cjs/components/Tabs/TabList.js +120 -0
  10. package/cjs/components/Tabs/TabListItem.js +75 -0
  11. package/cjs/components/Tabs/Tabs.js +98 -537
  12. package/cjs/components/Tabs/useActive.js +19 -0
  13. package/cjs/components/Tabs/useWidths.js +102 -0
  14. package/cjs/components/Toaster/PanelView.js +15 -13
  15. package/cjs/components/Toolbar/ToolbarMenu.js +0 -1
  16. package/cjs/components/Toolbar/index.js +1 -8
  17. package/cjs/components/index.js +0 -7
  18. package/cjs/index.js +1 -1
  19. package/dist/plesk-ui-library-rtl.css +1 -1
  20. package/dist/plesk-ui-library-rtl.css.map +1 -1
  21. package/dist/plesk-ui-library.css +1 -1
  22. package/dist/plesk-ui-library.css.map +1 -1
  23. package/dist/plesk-ui-library.js +668 -608
  24. package/dist/plesk-ui-library.js.map +1 -1
  25. package/dist/plesk-ui-library.min.js +5 -5
  26. package/dist/plesk-ui-library.min.js.map +1 -1
  27. package/esm/components/CodeEditor/CodeEditor.js +1 -2
  28. package/esm/components/Icon/constants.js +0 -1
  29. package/esm/components/List/List.js +6 -3
  30. package/esm/components/Tabs/FakeTabs.js +51 -0
  31. package/esm/components/Tabs/Tab.js +0 -1
  32. package/esm/components/Tabs/TabClose.js +28 -0
  33. package/esm/components/Tabs/TabIcon.js +14 -0
  34. package/esm/components/Tabs/TabLabel.js +27 -0
  35. package/esm/components/Tabs/TabList.js +111 -0
  36. package/esm/components/Tabs/TabListItem.js +68 -0
  37. package/esm/components/Tabs/Tabs.js +100 -537
  38. package/esm/components/Tabs/useActive.js +12 -0
  39. package/esm/components/Tabs/useWidths.js +95 -0
  40. package/esm/components/Toaster/PanelView.js +15 -13
  41. package/esm/components/Toolbar/ToolbarMenu.js +0 -1
  42. package/esm/components/Toolbar/index.js +1 -2
  43. package/esm/components/index.js +1 -1
  44. package/esm/index.js +1 -1
  45. package/package.json +9 -10
  46. package/styleguide/build/bundle.ef040f7a.js +2 -0
  47. package/styleguide/index.html +2 -2
  48. package/types/components/Carousel/Carousel.d.ts +1 -1
  49. package/types/components/Label/Label.d.ts +1 -1
  50. package/types/components/List/List.d.ts +8 -2
  51. package/types/components/Tabs/FakeTabs.d.ts +9 -0
  52. package/types/components/Tabs/SearchBar.d.ts +3 -3
  53. package/types/components/Tabs/TabClose.d.ts +9 -0
  54. package/types/components/Tabs/TabIcon.d.ts +7 -0
  55. package/types/components/Tabs/TabLabel.d.ts +9 -0
  56. package/types/components/Tabs/TabList.d.ts +14 -0
  57. package/types/components/Tabs/TabListItem.d.ts +12 -0
  58. package/types/components/Tabs/Tabs.d.ts +2 -52
  59. package/types/components/Tabs/useActive.d.ts +1 -0
  60. package/types/components/Tabs/useWidths.d.ts +16 -0
  61. package/types/components/Toolbar/index.d.ts +0 -1
  62. package/types/components/index.d.ts +1 -1
  63. package/types/utils/types/ComponentProps.d.ts +1 -1
  64. package/types/utils/types/PolymorphicComponent.d.ts +2 -2
  65. package/cjs/components/Toolbar/ToolbarBetaProvider.js +0 -23
  66. package/esm/components/Toolbar/ToolbarBetaProvider.js +0 -16
  67. package/styleguide/build/bundle.7ac8a2af.js +0 -2
  68. package/types/components/Toolbar/ToolbarBetaProvider.d.ts +0 -5
  69. /package/styleguide/build/{bundle.7ac8a2af.js.LICENSE.txt → bundle.ef040f7a.js.LICENSE.txt} +0 -0
@@ -105,8 +105,7 @@ class CodeEditor extends Component {
105
105
  this.codeMirror.scrollTo(scrollPosition.left, scrollPosition.top);
106
106
  }
107
107
  this.updateMode(this.props);
108
- // Save fn typing is missed by some reason.
109
- // @ts-ignore
108
+ // @ts-expect-error save fn typing is missed by some reason
110
109
  CodeMirror.commands.save = this.props.onSave;
111
110
  CodeMirror.commands.find = CodeMirror.commands.findPersistent;
112
111
  CodeMirror.commands.findNext = CodeMirror.commands.findPersistentNext;
@@ -1,5 +1,4 @@
1
1
  // Copyright 1999-2025. WebPros International GmbH. All rights reserved.
2
- /* eslint-disable max-len */
3
2
  // This file is generated by create-svg-sprite. Do not edit.
4
3
 
5
4
  export const NAMES_12 = ['advisor', 'archive', 'arrow-back', 'arrow-diagonal-out', 'arrow-down', 'arrow-down-circle-filled', 'arrow-down-in', 'arrow-down-out', 'arrow-down-tray', 'arrow-left', 'arrow-left-circle-filled', 'arrow-right', 'arrow-right-circle-filled', 'arrow-right-in', 'arrow-right-out', 'arrow-up', 'arrow-up-circle', 'arrow-up-circle-filled', 'arrow-up-in', 'arrow-up-in-cloud', 'arrow-up-out', 'arrow-up-tray', 'arrows-four-directions', 'arrows-inward', 'arrows-loop', 'arrows-opposite', 'arrows-outward', 'backup', 'backup2', 'bar-chart-vertical', 'bar-chart-vertical-arrow-up', 'bar-chart-vertical-lock', 'bell', 'book-email', 'boost', 'boundary', 'box-diagonal-bottom-in', 'box-diagonal-top-in', 'brush', 'bug', 'calendar', 'calendar-clock', 'camera', 'card', 'card-ribbon', 'card-row', 'card-tile', 'cd', 'cd-up-in-cloud', 'chain', 'chain-broken', 'chat', 'check-list', 'check-mark', 'check-mark-circle', 'check-mark-circle-filled', 'chevron-double-down', 'chevron-double-up', 'chevron-down', 'chevron-left', 'chevron-right', 'chevron-up', 'circle-diagonal', 'clean', 'clip', 'clock', 'clone', 'cloud', 'cloud-checkmark', 'cloud-crossed', 'cloud-graph', 'code', 'connection', 'console', 'console-filled', 'copy', 'copy-indicator', 'cpu', 'crane', 'credit-cards', 'cross-mark', 'cross-mark-circle', 'cross-mark-circle-filled', 'crown-transfer', 'dashboard', 'database', 'database-box', 'database-filled', 'database-plus', 'deploy', 'docker-filled', 'dollar', 'dollar-filled', 'dot', 'dot-big', 'emoticon-confused', 'emoticon-dead', 'emoticon-excited', 'emoticon-happy', 'emoticon-neutral', 'emoticon-sad', 'emoticon-smile', 'enter', 'exclamation-mark-circle', 'exclamation-mark-circle-filled', 'eye', 'eye-closed', 'facebook', 'facebook-filled', 'feedback', 'file', 'filter', 'filter-check-mark', 'fire', 'flag', 'flag-filled', 'flag-globe', 'floppy-disk', 'folder-closed', 'folder-key', 'folder-network', 'folder-open', 'folders-tree', 'forward-circle-filled', 'four-squares', 'gear', 'git', 'github', 'globe', 'hard-drive', 'hard-drive-key', 'hat', 'hexagons', 'home', 'info-circle', 'info-circle-filled', 'ip-addresses', 'joomla', 'kebab', 'key', 'label', 'label-plus', 'laravel', 'lifebuoy', 'lightbulb', 'limit', 'linux', 'list', 'list-check-mark', 'location', 'lock-closed', 'lock-closed-check', 'lock-closed-filled', 'lock-open', 'lock-open-cross', 'lock-open-filled', 'mail', 'mail-circle-filled', 'mail-settings', 'megaphone', 'menu', 'menu-thin', 'microsoft', 'minimize', 'minus', 'minus-circle', 'minus-circle-filled', 'monitoring', 'monitoring-off', 'my-little-admin', 'net', 'nine-dots', 'node-js', 'package', 'panel', 'panel-check', 'panel-eye', 'panel-key', 'panel-settings', 'panels', 'pause-circle', 'pencil', 'pencil-dialog', 'php', 'phpmyadmin', 'pin', 'pipette', 'plans', 'plugins', 'plus', 'plus-circle', 'plus-circle-filled', 'power', 'projects', 'puzzle', 'python', 'question-mark-circle', 'question-mark-circle-filled', 'ram', 'react-js', 'recycle', 'redirect-circle-filled', 'refresh', 'reload', 'remove', 'reset', 'resource', 'ribbon', 'rocket', 'ruby', 'sand-clock', 'scan', 'screen', 'search', 'security-check', 'send', 'server', 'servers', 'share', 'shield', 'shield-attention-filled', 'shield-chain', 'shield-filled', 'shopping-cart', 'sidebar-right-hide', 'sidebar-right-show', 'signal-light', 'site-page', 'sleep', 'sliders', 'square-with-circles', 'ssl-it', 'star', 'star-circle-filled', 'star-filled', 'star-half-filled', 'start', 'start-circle', 'start-filled', 'stop', 'stop-circle', 'storage', 'themes', 'three-dots-horizontal', 'three-dots-vertical', 'tools', 'transfer', 'triangle-exclamation-mark', 'triangle-exclamation-mark-filled', 'unarchive', 'user', 'volume', 'web', 'web-plus', 'web-settings', 'windows', 'woocommerce', 'wordpress', 'wordpress-minus', 'zero-circle-filled'];
@@ -363,7 +363,8 @@ class List extends Component {
363
363
  vertical,
364
364
  rowKey,
365
365
  totalRows,
366
- filtered
366
+ filtered,
367
+ autoExpandSingleItem
367
368
  } = _ref5;
368
369
  let {
369
370
  prevSortColumn,
@@ -387,7 +388,7 @@ class List extends Component {
387
388
  const isSingleElementInCurrentExpanded = () => data && state.expandedRows.includes(getRowKey(data[0], {
388
389
  rowKey
389
390
  }));
390
- if (renderRowBody && data?.length === 1 && (!pagination || totalRows === 1) && (!prevData || prevData?.length === 0 || isSingleElementInCurrentExpanded()) && (!filtered || isSingleElementInCurrentExpanded())) {
391
+ if (renderRowBody && data?.length === 1 && (!pagination || totalRows === 1) && (!prevData || prevData?.length === 0 || isSingleElementInCurrentExpanded()) && (!filtered || isSingleElementInCurrentExpanded()) && autoExpandSingleItem) {
391
392
  const key = getRowKey(data[0], {
392
393
  rowKey
393
394
  });
@@ -1064,6 +1065,7 @@ class List extends Component {
1064
1065
  rowProps,
1065
1066
  reorderable,
1066
1067
  onReorderEnd,
1068
+ autoExpandSingleItem,
1067
1069
  ...props
1068
1070
  } = this.props;
1069
1071
  const {
@@ -1439,6 +1441,7 @@ _defineProperty(List, "defaultProps", {
1439
1441
  loading: false,
1440
1442
  rowProps: undefined,
1441
1443
  reorderable: false,
1442
- onReorderEnd: undefined
1444
+ onReorderEnd: undefined,
1445
+ autoExpandSingleItem: true
1443
1446
  });
1444
1447
  export default List;
@@ -0,0 +1,51 @@
1
+ // Copyright 1999-2025. WebPros International GmbH. All rights reserved.
2
+
3
+ import { useRef, Children } from 'react';
4
+ import classNames from 'classnames';
5
+ import { useResizeObserver } from '../../hooks';
6
+ import Icon from '../Icon';
7
+ import Tab from './Tab';
8
+ import TabListItem from './TabListItem';
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ const FakeTabs = _ref => {
11
+ let {
12
+ children,
13
+ onResize,
14
+ baseClassName
15
+ } = _ref;
16
+ const tabsRef = useRef(null);
17
+ useResizeObserver({
18
+ ref: tabsRef,
19
+ onResize
20
+ });
21
+ const list = /*#__PURE__*/_jsxs("ul", {
22
+ ref: tabsRef,
23
+ className: classNames(`${baseClassName}__tab-list`, `${baseClassName}__tab-list--fake`),
24
+ children: [Children.map(children, (tab, index) => {
25
+ if (!tab || tab.type !== Tab) {
26
+ return null;
27
+ }
28
+ return /*#__PURE__*/_jsx(TabListItem, {
29
+ // eslint-disable-line react/no-array-index-key
30
+ tab: tab,
31
+ baseClassName: baseClassName,
32
+ isFake: true
33
+ }, index);
34
+ }), /*#__PURE__*/_jsx("li", {
35
+ className: classNames(`${baseClassName}__tab`, `${baseClassName}__tab--more`),
36
+ children: /*#__PURE__*/_jsx("a", {
37
+ className: `${baseClassName}__link`,
38
+ tabIndex: -1,
39
+ children: /*#__PURE__*/_jsx(Icon, {
40
+ name: "three-dots-horizontal"
41
+ })
42
+ })
43
+ })]
44
+ });
45
+ return /*#__PURE__*/_jsx("div", {
46
+ className: `${baseClassName}__fake-list-wrapper`,
47
+ "aria-hidden": true,
48
+ children: list
49
+ });
50
+ };
51
+ export default FakeTabs;
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  // Copyright 1999-2025. WebPros International GmbH. All rights reserved.
3
- /* eslint-disable react/no-unused-prop-types */
4
3
 
5
4
  /**
6
5
  * `Tab` is an individual element of the [Tabs](#!/Tabs) component.
@@ -0,0 +1,28 @@
1
+ // Copyright 1999-2025. WebPros International GmbH. All rights reserved.
2
+
3
+ import Icon from '../Icon';
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const TabClose = _ref => {
6
+ let {
7
+ tabMode,
8
+ onClose,
9
+ baseClassName
10
+ } = _ref;
11
+ if (typeof onClose !== 'function') {
12
+ return null;
13
+ }
14
+ return /*#__PURE__*/_jsx("button", {
15
+ className: `${baseClassName}__${tabMode}-close`,
16
+ type: "button",
17
+ onClick: e => {
18
+ e.preventDefault();
19
+ e.stopPropagation();
20
+ onClose(e);
21
+ },
22
+ children: /*#__PURE__*/_jsx(Icon, {
23
+ className: `${baseClassName}__${tabMode}-close-icon`,
24
+ name: "cross-mark"
25
+ })
26
+ });
27
+ };
28
+ export default TabClose;
@@ -0,0 +1,14 @@
1
+ // Copyright 1999-2025. WebPros International GmbH. All rights reserved.
2
+
3
+ import Icon, { ICON_SIZE_16 } from '../Icon';
4
+ const TabIcon = _ref => {
5
+ let {
6
+ icon,
7
+ baseClassName
8
+ } = _ref;
9
+ return Icon.create(icon, {
10
+ size: ICON_SIZE_16,
11
+ className: `${baseClassName}__tab-icon`
12
+ });
13
+ };
14
+ export default TabIcon;
@@ -0,0 +1,27 @@
1
+ // Copyright 1999-2025. WebPros International GmbH. All rights reserved.
2
+
3
+ import { cloneElement, isValidElement } from 'react';
4
+ import classNames from 'classnames';
5
+ import Label from '../Label';
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ const TabLabel = _ref => {
8
+ let {
9
+ label,
10
+ tabMode,
11
+ baseClassName
12
+ } = _ref;
13
+ if (typeof label === 'string') {
14
+ return /*#__PURE__*/_jsx(Label, {
15
+ className: `${baseClassName}__${tabMode}-label`,
16
+ intent: "danger",
17
+ children: label
18
+ });
19
+ }
20
+ if (/*#__PURE__*/isValidElement(label)) {
21
+ return /*#__PURE__*/cloneElement(label, {
22
+ className: classNames(`${baseClassName}__${tabMode}-label`, label.props.className)
23
+ });
24
+ }
25
+ return null;
26
+ };
27
+ export default TabLabel;
@@ -0,0 +1,111 @@
1
+ // Copyright 1999-2025. WebPros International GmbH. All rights reserved.
2
+
3
+ import { Children } from 'react';
4
+ import classNames from 'classnames';
5
+ import Dropdown from '../Dropdown';
6
+ import Icon from '../Icon';
7
+ import Menu, { MenuItem } from '../Menu';
8
+ import Tab from './Tab';
9
+ import TabClose from './TabClose';
10
+ import TabIcon from './TabIcon';
11
+ import TabLabel from './TabLabel';
12
+ import TabListItem from './TabListItem';
13
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
14
+ const TabList = _ref => {
15
+ let {
16
+ children,
17
+ tabListRef,
18
+ active,
19
+ onTabClick,
20
+ visibleLength,
21
+ monospacedWidth,
22
+ baseClassName
23
+ } = _ref;
24
+ if (!Children.toArray(children).length) {
25
+ return null;
26
+ }
27
+ let tabs = Children.toArray(children);
28
+ tabs = tabs.filter(child => child?.type === Tab);
29
+ const listChildren = tabs.slice(0, visibleLength);
30
+ const menuChildren = tabs.slice(visibleLength);
31
+ const listItems = Children.map(listChildren, (tab, index) => {
32
+ const position = index + 1;
33
+ return /*#__PURE__*/_jsx(TabListItem, {
34
+ // eslint-disable-line react/no-array-index-key
35
+ tab: tab,
36
+ baseClassName: baseClassName,
37
+ selected: position === active,
38
+ onClick: () => onTabClick(position),
39
+ monospacedWidth: monospacedWidth
40
+ }, index);
41
+ });
42
+ const menuItems = Children.map(menuChildren, (tab, index) => {
43
+ const position = listChildren.length + index + 1;
44
+ const {
45
+ title,
46
+ label,
47
+ icon,
48
+ onActivate,
49
+ onClose,
50
+ component: Tag = 'a',
51
+ ...tabProps
52
+ } = tab.props;
53
+ return /*#__PURE__*/_jsx(MenuItem, {
54
+ // eslint-disable-line react/no-array-index-key
55
+ icon: /*#__PURE__*/_jsx(TabIcon, {
56
+ icon: icon,
57
+ baseClassName: baseClassName
58
+ }),
59
+ label: /*#__PURE__*/_jsxs(_Fragment, {
60
+ children: [/*#__PURE__*/_jsx(TabLabel, {
61
+ label: label,
62
+ tabMode: "menu-item",
63
+ baseClassName: baseClassName
64
+ }), /*#__PURE__*/_jsx(TabClose, {
65
+ onClose: onClose,
66
+ tabMode: "menu-item",
67
+ baseClassName: baseClassName
68
+ })]
69
+ }),
70
+ active: active === position,
71
+ onClick: () => onTabClick(position),
72
+ className: `${baseClassName}__menu-item`,
73
+ component: Tag,
74
+ ...tabProps,
75
+ children: title
76
+ }, index);
77
+ });
78
+ const moreSelected = active > listChildren.length;
79
+ return /*#__PURE__*/_jsxs("ul", {
80
+ ref: tabListRef,
81
+ className: `${baseClassName}__tab-list`,
82
+ role: "tablist",
83
+ children: [listItems, menuItems.length > 0 && /*#__PURE__*/_jsx("li", {
84
+ className: classNames(`${baseClassName}__tab`, moreSelected && `${baseClassName}__tab--selected`, `${baseClassName}__tab--more`),
85
+ role: "presentation",
86
+ "aria-selected": moreSelected || undefined,
87
+ children: /*#__PURE__*/_jsx(Dropdown, {
88
+ className: `${baseClassName}__dropdown`,
89
+ menu: /*#__PURE__*/_jsx(Menu, {
90
+ children: menuItems
91
+ }),
92
+ menuPlacement: "bottom-end",
93
+ children: /*#__PURE__*/_jsx("a", {
94
+ className: `${baseClassName}__link`,
95
+ role: "tab",
96
+ tabIndex: 0,
97
+ "aria-selected": moreSelected || undefined,
98
+ onKeyDown: e => {
99
+ if (e.key === 'Enter') {
100
+ e.currentTarget.click();
101
+ }
102
+ },
103
+ children: /*#__PURE__*/_jsx(Icon, {
104
+ name: "three-dots-horizontal"
105
+ })
106
+ })
107
+ })
108
+ })]
109
+ });
110
+ };
111
+ export default TabList;
@@ -0,0 +1,68 @@
1
+ // Copyright 1999-2025. WebPros International GmbH. All rights reserved.
2
+
3
+ import classNames from 'classnames';
4
+ import { wrapFunction } from '../utils';
5
+ import TabClose from './TabClose';
6
+ import TabIcon from './TabIcon';
7
+ import TabLabel from './TabLabel';
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ const TabListItem = _ref => {
10
+ let {
11
+ tab,
12
+ selected,
13
+ onClick,
14
+ monospacedWidth,
15
+ baseClassName,
16
+ isFake = false
17
+ } = _ref;
18
+ const {
19
+ title,
20
+ label,
21
+ icon,
22
+ onActivate,
23
+ onClose,
24
+ component: Tag = 'a',
25
+ style = {},
26
+ ...tabProps
27
+ } = tab.props;
28
+ const closable = typeof onClose === 'function';
29
+ tabProps.tabIndex = isFake ? -1 : tabProps.tabIndex || 0;
30
+ if (!isFake) {
31
+ tabProps.onKeyDown = wrapFunction(tabProps.onKeyDown, e => {
32
+ if (e.key === 'Enter') {
33
+ e.currentTarget.click();
34
+ }
35
+ });
36
+ }
37
+ return /*#__PURE__*/_jsx("li", {
38
+ className: classNames(`${baseClassName}__tab`, selected && `${baseClassName}__tab--selected`, closable && `${baseClassName}__tab--closable`),
39
+ role: isFake ? undefined : 'presentation',
40
+ children: /*#__PURE__*/_jsxs(Tag, {
41
+ className: `${baseClassName}__link`,
42
+ role: isFake ? undefined : 'tab',
43
+ "aria-selected": selected || undefined,
44
+ onClick: onClick,
45
+ style: {
46
+ width: monospacedWidth || undefined,
47
+ ...style
48
+ },
49
+ ...tabProps,
50
+ children: [/*#__PURE__*/_jsx(TabIcon, {
51
+ icon: icon,
52
+ baseClassName: baseClassName
53
+ }), /*#__PURE__*/_jsx("span", {
54
+ className: `${baseClassName}__tab-title`,
55
+ children: title
56
+ }), /*#__PURE__*/_jsx(TabLabel, {
57
+ label: label,
58
+ tabMode: "tab",
59
+ baseClassName: baseClassName
60
+ }), /*#__PURE__*/_jsx(TabClose, {
61
+ onClose: onClose,
62
+ tabMode: "tab",
63
+ baseClassName: baseClassName
64
+ })]
65
+ })
66
+ });
67
+ };
68
+ export default TabListItem;