@plesk/ui-library 3.35.6 → 3.35.8

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 (167) hide show
  1. package/cjs/components/AutoClosable/AutoClosable.js +1 -0
  2. package/cjs/components/InputNumber/InputNumber.js +2 -2
  3. package/cjs/components/Item/Item.js +64 -153
  4. package/cjs/components/Overlay/Overlay.js +35 -25
  5. package/cjs/components/Popover/Popover.js +1 -1
  6. package/cjs/components/SegmentedControl/SegmentedControl.js +1 -0
  7. package/cjs/components/Tabs/SearchBar.js +40 -147
  8. package/cjs/components/Tabs/Tab.js +2 -49
  9. package/cjs/components/Tabs/Tabs.js +48 -99
  10. package/cjs/components/Toolbar/ToolbarItem.js +1 -0
  11. package/cjs/components/index.js +14 -11
  12. package/cjs/index.js +1 -1
  13. package/dist/plesk-ui-library-rtl.css +1 -1
  14. package/dist/plesk-ui-library-rtl.css.map +1 -1
  15. package/dist/plesk-ui-library.css +1 -1
  16. package/dist/plesk-ui-library.css.map +1 -1
  17. package/dist/plesk-ui-library.js +441 -626
  18. package/dist/plesk-ui-library.js.map +1 -1
  19. package/dist/plesk-ui-library.min.js +8 -12
  20. package/dist/plesk-ui-library.min.js.map +1 -1
  21. package/esm/components/AutoClosable/AutoClosable.js +1 -0
  22. package/esm/components/InputNumber/InputNumber.js +2 -2
  23. package/esm/components/Item/Item.js +64 -153
  24. package/esm/components/Overlay/Overlay.js +35 -25
  25. package/esm/components/Popover/Popover.js +1 -1
  26. package/esm/components/SegmentedControl/SegmentedControl.js +1 -0
  27. package/esm/components/Tabs/SearchBar.js +40 -147
  28. package/esm/components/Tabs/Tab.js +1 -49
  29. package/esm/components/Tabs/Tabs.js +49 -99
  30. package/esm/components/Toolbar/ToolbarItem.js +1 -0
  31. package/esm/components/index.js +1 -2
  32. package/esm/index.js +1 -1
  33. package/package.json +28 -33
  34. package/styleguide/build/bundle.50841a29.js +2 -0
  35. package/styleguide/build/{bundle.8a07b2dd.js.LICENSE.txt → bundle.50841a29.js.LICENSE.txt} +27 -23
  36. package/styleguide/index.html +2 -2
  37. package/types/src/components/Action/Action.d.ts +1 -1
  38. package/types/src/components/Alert/Alert.d.ts +1 -1
  39. package/types/src/components/AutoClosable/AutoClosable.d.ts +23 -21
  40. package/types/src/components/AuxiliaryActions/AuxiliaryActions.d.ts +1 -1
  41. package/types/src/components/Badge/Badge.d.ts +1 -1
  42. package/types/src/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  43. package/types/src/components/Button/Button.d.ts +2 -2
  44. package/types/src/components/Button/ButtonContext.d.ts +1 -1
  45. package/types/src/components/ButtonGroup/ButtonGroup.d.ts +1 -1
  46. package/types/src/components/Card/PreviewPanel.d.ts +2 -2
  47. package/types/src/components/Carousel/Carousel.d.ts +1 -1
  48. package/types/src/components/Checkbox/Checkbox.d.ts +1 -1
  49. package/types/src/components/ClosingConfirmation/useClosingConfirmation.d.ts +1 -1
  50. package/types/src/components/ComboBox/ComboBox.d.ts +2 -2
  51. package/types/src/components/ComboBox/ComboBoxOption.d.ts +1 -1
  52. package/types/src/components/ComboBoxDropdown/ComboBoxDropdown.d.ts +5 -5
  53. package/types/src/components/ConsoleOutput/ConsoleOutput.d.ts +2 -2
  54. package/types/src/components/ContentLoader/ContentLoader.d.ts +2 -2
  55. package/types/src/components/ContentLoader/IconsLoader.d.ts +2 -2
  56. package/types/src/components/Cuttable/Cuttable.d.ts +3 -3
  57. package/types/src/components/Dialog/Dialog.d.ts +3 -3
  58. package/types/src/components/DistractionFreeModeContext/DistractionFreeModeContext.d.ts +1 -1
  59. package/types/src/components/Drawer/Drawer.d.ts +1 -1
  60. package/types/src/components/Drawer/DrawerProgress.d.ts +4 -4
  61. package/types/src/components/Drawer/Header.d.ts +1 -1
  62. package/types/src/components/Dropdown/Dropdown.d.ts +1 -1
  63. package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessage.d.ts +1 -1
  64. package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessageActions.d.ts +1 -1
  65. package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessageDescription.d.ts +1 -1
  66. package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessageSeparator.d.ts +1 -1
  67. package/types/src/components/ExtendedStatusMessage/ExtendedStatusMessageTitle.d.ts +1 -1
  68. package/types/src/components/Figure/Figure.d.ts +1 -1
  69. package/types/src/components/Form/Form.d.ts +2 -2
  70. package/types/src/components/Form/types.d.ts +7 -7
  71. package/types/src/components/Form/utils.d.ts +3 -3
  72. package/types/src/components/FormFieldCheckbox/FormFieldCheckbox.d.ts +1 -1
  73. package/types/src/components/FormFieldPassword/FormFieldPassword.d.ts +4 -4
  74. package/types/src/components/FormFieldPassword/PasswordMeter.d.ts +1 -1
  75. package/types/src/components/FormFieldPassword/estimatePassword.d.ts +2 -2
  76. package/types/src/components/FormFieldSelect/FormFieldSelect.d.ts +2 -2
  77. package/types/src/components/FormFieldText/FormFieldText.d.ts +4 -4
  78. package/types/src/components/Grid/Grid.d.ts +4 -4
  79. package/types/src/components/GridCol/GridCol.d.ts +2 -2
  80. package/types/src/components/Heading/Heading.d.ts +1 -1
  81. package/types/src/components/Hint/Hint.d.ts +1 -1
  82. package/types/src/components/Icon/Icon.d.ts +3 -3
  83. package/types/src/components/Icon/constants.d.ts +1 -1
  84. package/types/src/components/InPlaceEdit/InPlaceEdit.d.ts +2 -2
  85. package/types/src/components/Input/Input.d.ts +4 -3
  86. package/types/src/components/InputFile/InputFile.d.ts +1 -1
  87. package/types/src/components/Item/Item.d.ts +79 -0
  88. package/types/src/components/Item/index.d.ts +2 -0
  89. package/types/src/components/ItemLink/ItemLink.d.ts +1 -1
  90. package/types/src/components/ItemList/ItemList.d.ts +7 -7
  91. package/types/src/components/Label/Label.d.ts +3 -3
  92. package/types/src/components/Layer/Layer.d.ts +1 -1
  93. package/types/src/components/Layout/Layout.d.ts +9 -9
  94. package/types/src/components/Link/Link.d.ts +3 -3
  95. package/types/src/components/List/ListAction.d.ts +3 -3
  96. package/types/src/components/List/ListActions.d.ts +2 -2
  97. package/types/src/components/List/ListActionsDivider.d.ts +2 -2
  98. package/types/src/components/List/ListEmptyView.d.ts +1 -1
  99. package/types/src/components/List/ListOperation.d.ts +9 -5
  100. package/types/src/components/List/ListOperationContext.d.ts +1 -1
  101. package/types/src/components/LocaleProvider/LocaleProvider.d.ts +5 -5
  102. package/types/src/components/Markdown/Markdown.d.ts +2 -2
  103. package/types/src/components/Media/Media.d.ts +1 -1
  104. package/types/src/components/Media/MediaSection.d.ts +1 -1
  105. package/types/src/components/Menu/Menu.d.ts +1 -1
  106. package/types/src/components/Menu/MenuBaseItem.d.ts +3 -3
  107. package/types/src/components/Menu/MenuDivider.d.ts +1 -1
  108. package/types/src/components/Menu/MenuHeader.d.ts +1 -1
  109. package/types/src/components/Menu/MenuItem.d.ts +2 -2
  110. package/types/src/components/Menu/MenuSelectableItem.d.ts +2 -2
  111. package/types/src/components/Overlay/Overlay.d.ts +2 -2
  112. package/types/src/components/PageHeader/PageHeader.d.ts +1 -1
  113. package/types/src/components/Pagination/Pagination.d.ts +2 -2
  114. package/types/src/components/Panel/Panel.d.ts +3 -3
  115. package/types/src/components/Paragraph/Paragraph.d.ts +1 -1
  116. package/types/src/components/Plaintext/Plaintext.d.ts +1 -1
  117. package/types/src/components/Popover/Popover.d.ts +5 -3
  118. package/types/src/components/Popper/Popper.d.ts +2 -2
  119. package/types/src/components/Progress/Progress.d.ts +2 -2
  120. package/types/src/components/ProgressBar/ProgressBar.d.ts +1 -1
  121. package/types/src/components/ProgressBar/ProgressIndicator.d.ts +1 -1
  122. package/types/src/components/ProgressDialog/ProgressDialog.d.ts +2 -2
  123. package/types/src/components/ProgressStep/ProgressStep.d.ts +2 -2
  124. package/types/src/components/Radio/Radio.d.ts +1 -1
  125. package/types/src/components/Rating/Rating.d.ts +1 -1
  126. package/types/src/components/Section/Section.d.ts +5 -5
  127. package/types/src/components/Section/SectionItem.d.ts +1 -1
  128. package/types/src/components/SegmentedControl/SegmentedControl.d.ts +16 -12
  129. package/types/src/components/Select/MultiValue.d.ts +1 -1
  130. package/types/src/components/Select/Select.d.ts +1 -1
  131. package/types/src/components/Select/SelectControl.d.ts +1 -1
  132. package/types/src/components/Select/SelectOption.d.ts +1 -1
  133. package/types/src/components/Select/SelectOptionGroup.d.ts +1 -1
  134. package/types/src/components/Select/structures.d.ts +3 -3
  135. package/types/src/components/Skeleton/Skeleton.d.ts +1 -1
  136. package/types/src/components/Spinner/Spinner.d.ts +1 -1
  137. package/types/src/components/SplitButton/SplitButton.d.ts +1 -1
  138. package/types/src/components/Spot/Spot.d.ts +1 -1
  139. package/types/src/components/Spot/SpotPopup.d.ts +5 -3
  140. package/types/src/components/Squeezer/Squeezer.d.ts +2 -2
  141. package/types/src/components/Status/Status.d.ts +3 -3
  142. package/types/src/components/StatusMessage/StatusMessage.d.ts +1 -1
  143. package/types/src/components/Subnav/Subnav.d.ts +1 -1
  144. package/types/src/components/Switch/Switch.d.ts +3 -2
  145. package/types/src/components/SwitchesPanel/SwitchesPanel.d.ts +1 -1
  146. package/types/src/components/SwitchesPanelItem/SwitchesPanelItem.d.ts +1 -1
  147. package/types/src/components/Tabs/SearchBar.d.ts +107 -0
  148. package/types/src/components/Tabs/Tab.d.ts +62 -0
  149. package/types/src/components/Tabs/Tabs.d.ts +111 -0
  150. package/types/src/components/Tabs/index.d.ts +6 -0
  151. package/types/src/components/Text/Text.d.ts +1 -1
  152. package/types/src/components/TextArea/TextArea.d.ts +4 -4
  153. package/types/src/components/Toast/Toast.d.ts +2 -2
  154. package/types/src/components/Toaster/Toaster.d.ts +4 -4
  155. package/types/src/components/Toolbar/RegistryContext.d.ts +2 -2
  156. package/types/src/components/Toolbar/Toolbar.d.ts +2 -2
  157. package/types/src/components/Toolbar/ToolbarExpander.d.ts +2 -2
  158. package/types/src/components/Toolbar/ToolbarGroup.d.ts +1 -1
  159. package/types/src/components/Toolbar/ToolbarItem.d.ts +1 -1
  160. package/types/src/components/Toolbar/ToolbarMenu.d.ts +1 -1
  161. package/types/src/components/Tooltip/Tooltip.d.ts +2 -2
  162. package/types/src/components/Tour/Tour.d.ts +2 -2
  163. package/types/src/components/Translate/Translate.d.ts +5 -3
  164. package/types/src/components/index.d.ts +3 -2
  165. package/types/src/components/utils.d.ts +5 -5
  166. package/types/src/utils/types/PolymorphicComponent.d.ts +5 -5
  167. package/styleguide/build/bundle.8a07b2dd.js +0 -2
@@ -1,24 +1,23 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
3
3
 
4
- import React, { cloneElement, isValidElement, Component, Fragment, Children } from 'react';
5
- import PropTypes from 'prop-types';
6
4
  import classNames from 'classnames';
5
+ import { Children, cloneElement, Component, Fragment, isValidElement } from 'react';
7
6
  import Measure from 'react-measure';
8
7
  import { CLS_PREFIX } from '../../constants';
8
+ import Dropdown from '../Dropdown';
9
9
  import Icon, { ICON_SIZE_16 } from '../Icon';
10
10
  import Label from '../Label';
11
- import Dropdown from '../Dropdown';
12
11
  import Menu, { MenuItem } from '../Menu';
13
- import Tab from './Tab';
14
12
  import ResponsiveContext from '../ResponsiveContext';
15
13
  import { wrapFunction } from '../utils';
14
+ import Tab from './Tab';
16
15
  import { jsxs as _jsxs } from "react/jsx-runtime";
17
16
  import { jsx as _jsx } from "react/jsx-runtime";
17
+ import { Fragment as _Fragment } from "react/jsx-runtime";
18
18
  const ADDON_LEFT_PADDING = 5;
19
19
  const MIN_ADDON_WIDTH_DEFAULT = 150;
20
20
  const COLLAPSED_SEARCH_WIDTH = 60;
21
-
22
21
  /**
23
22
  * `Tabs` component is a content area with a group of individual [Tab](#!/Tab) elements, each displaying different content
24
23
  * in the same screen area. `Tabs` are used when you have too much content to display in one place at the same time, so
@@ -34,9 +33,12 @@ class Tabs extends Component {
34
33
  collapsedLength: 0,
35
34
  compact: false,
36
35
  searching: false,
37
- monospacedWidth: null
36
+ monospacedWidth: 0
38
37
  });
39
- _defineProperty(this, "widths", null);
38
+ _defineProperty(this, "widths", void 0);
39
+ _defineProperty(this, "addon", void 0);
40
+ _defineProperty(this, "tabsnavRef", void 0);
41
+ _defineProperty(this, "moreTabsRef", null);
40
42
  _defineProperty(this, "checkAdaptive", () => {
41
43
  let {
42
44
  compact,
@@ -52,12 +54,12 @@ class Tabs extends Component {
52
54
  widths,
53
55
  addon
54
56
  } = this;
55
- let monospacedWidth = null;
57
+ let monospacedWidth = 0;
56
58
  const getMonospacedWidth = () => monospacedWidth;
57
59
  if (!widths) {
58
60
  return;
59
61
  }
60
- const addonMinWidth = ADDON_LEFT_PADDING + (addonMinWidthProp || (search ? search.props.minWidth : MIN_ADDON_WIDTH_DEFAULT));
62
+ const addonMinWidth = ADDON_LEFT_PADDING + (addonMinWidthProp || (search?.props.minWidth ?? MIN_ADDON_WIDTH_DEFAULT));
61
63
  const searchWidth = compact && search ? COLLAPSED_SEARCH_WIDTH + ADDON_LEFT_PADDING : 0;
62
64
  const {
63
65
  more,
@@ -68,7 +70,7 @@ class Tabs extends Component {
68
70
  const tabsNumber = tabs.length;
69
71
  let lastTabIndex = tabsNumber - 1 - collapsedLength;
70
72
  if (monospaced) {
71
- monospacedWidth = tabs.slice(0, lastTabIndex + 1).reduce((max, tab) => tab > max ? tab : max, 0);
73
+ monospacedWidth = Math.max(...tabs.slice(0, lastTabIndex + 1));
72
74
  tabs = tabs.map(getMonospacedWidth);
73
75
  }
74
76
  const getListWidth = () => {
@@ -140,9 +142,7 @@ class Tabs extends Component {
140
142
  collapsedLength,
141
143
  monospacedWidth
142
144
  };
143
- const keys = Object.keys(newState);
144
- for (let i = 0; i < keys.length; i++) {
145
- const key = keys[i];
145
+ for (const key of Object.keys(newState)) {
146
146
  if (JSON.stringify(newState[key]) === JSON.stringify(this.state[key])) {
147
147
  delete newState[key];
148
148
  }
@@ -177,7 +177,7 @@ class Tabs extends Component {
177
177
  tabs,
178
178
  more: more.offsetWidth,
179
179
  container: this.tabsnavRef.offsetWidth,
180
- margin: more.offsetWidth - more.querySelector(`.${baseClassName}__link`).offsetWidth
180
+ margin: more.offsetWidth - (more.querySelector(`.${baseClassName}__link`)?.offsetWidth ?? 0)
181
181
  };
182
182
  }
183
183
  this.checkAdaptive();
@@ -241,9 +241,9 @@ class Tabs extends Component {
241
241
  children: /*#__PURE__*/_jsxs(Tag, {
242
242
  className: `${baseClassName}__link`,
243
243
  role: "tab",
244
- "aria-selected": selected || null,
244
+ "aria-selected": selected || undefined,
245
245
  style: {
246
- width: monospacedWidth
246
+ width: monospacedWidth || undefined
247
247
  },
248
248
  onClick: handleClick,
249
249
  ...tabProps,
@@ -270,21 +270,16 @@ class Tabs extends Component {
270
270
  return nextState;
271
271
  }
272
272
  componentDidUpdate() {
273
- if (!this.widths || this.props.children.length !== this.widths.tabs.length) {
274
- setTimeout(() => this.handleResize(), 0);
273
+ if (!this.widths || Children.count(this.props.children) !== this.widths.tabs.length) {
274
+ setTimeout(() => this.handleResize());
275
275
  }
276
276
  }
277
277
  onClick(active) {
278
278
  this.setState({
279
279
  active
280
280
  });
281
- const tab = this.props.children[active - 1];
282
- const {
283
- onActivate
284
- } = tab.props;
285
- if (onActivate) {
286
- onActivate();
287
- }
281
+ const tab = Array.isArray(this.props.children) ? this.props.children[active - 1] : this.props.children;
282
+ tab?.props?.onActivate?.();
288
283
  }
289
284
  renderTabLabel(tabMode, label) {
290
285
  const {
@@ -331,7 +326,7 @@ class Tabs extends Component {
331
326
  children
332
327
  } = this.props;
333
328
  const childrenCount = Children.count(children);
334
- if (!childrenCount) {
329
+ if (!childrenCount || !children) {
335
330
  return null;
336
331
  }
337
332
  return /*#__PURE__*/_jsxs("ul", {
@@ -357,19 +352,19 @@ class Tabs extends Component {
357
352
  className: classNames(`${baseClassName}__tab`, closeBlock && `${baseClassName}__tab--closable`),
358
353
  children: [/*#__PURE__*/_jsxs("a", {
359
354
  className: `${baseClassName}__link`,
360
- tabIndex: "-1",
355
+ tabIndex: -1,
361
356
  style: tabProps.style,
362
357
  children: [iconBlock, /*#__PURE__*/_jsx("span", {
363
358
  className: `${baseClassName}__tab-title`,
364
359
  children: title
365
360
  }), this.renderTabLabel('tab', label)]
366
361
  }), closeBlock]
367
- }, title);
362
+ }, `${title}`);
368
363
  }), /*#__PURE__*/_jsx("li", {
369
364
  className: classNames(`${baseClassName}__tab`, `${baseClassName}__tab--more`),
370
365
  children: /*#__PURE__*/_jsx("a", {
371
366
  className: `${baseClassName}__link`,
372
- tabIndex: "-1",
367
+ tabIndex: -1,
373
368
  children: /*#__PURE__*/_jsx(Icon, {
374
369
  name: "three-dots-horizontal"
375
370
  })
@@ -390,7 +385,10 @@ class Tabs extends Component {
390
385
  Children.forEach(children, (child, index) => {
391
386
  const hidden = index > lastTabIndex;
392
387
  const tabMode = hidden ? 'menu-item' : 'tab';
393
- (hidden ? hiddenItems : visibleItems).push(this.renderTabItem(child, index, tabMode));
388
+ const renderedTab = this.renderTabItem(child, index, tabMode);
389
+ if (renderedTab) {
390
+ (hidden ? hiddenItems : visibleItems).push(renderedTab);
391
+ }
394
392
  });
395
393
  return {
396
394
  visibleItems,
@@ -420,7 +418,7 @@ class Tabs extends Component {
420
418
  ref: ref => this.moreTabsRef = ref,
421
419
  className: classNames(`${baseClassName}__tab`, moreSelected && `${baseClassName}__tab--selected`, `${baseClassName}__tab--more`),
422
420
  role: "presentation",
423
- "aria-selected": moreSelected || null,
421
+ "aria-selected": moreSelected || undefined,
424
422
  children: /*#__PURE__*/_jsx(Dropdown, {
425
423
  className: `${baseClassName}__dropdown`,
426
424
  menu: /*#__PURE__*/_jsx(Menu, {
@@ -430,8 +428,8 @@ class Tabs extends Component {
430
428
  children: /*#__PURE__*/_jsx("a", {
431
429
  className: `${baseClassName}__link`,
432
430
  role: "tab",
433
- tabIndex: "0",
434
- "aria-selected": moreSelected || null,
431
+ tabIndex: 0,
432
+ "aria-selected": moreSelected || undefined,
435
433
  children: /*#__PURE__*/_jsx(Icon, {
436
434
  name: "three-dots-horizontal"
437
435
  })
@@ -445,6 +443,9 @@ class Tabs extends Component {
445
443
  baseClassName,
446
444
  search
447
445
  } = this.props;
446
+ if (!search) {
447
+ return null;
448
+ }
448
449
  const {
449
450
  compact
450
451
  } = this.state;
@@ -478,7 +479,8 @@ class Tabs extends Component {
478
479
  if (!childrenCount) {
479
480
  return null;
480
481
  }
481
- let addonBlock = addon || placeholder;
482
+ const addonElement = addon || placeholder;
483
+ let addonBlock = addonElement;
482
484
  const addonProps = {};
483
485
  let searchBlock = null;
484
486
  if (search) {
@@ -489,19 +491,21 @@ class Tabs extends Component {
489
491
  };
490
492
  if (compact) {
491
493
  if (searching) {
492
- searchProps.maxWidth = null;
493
- searchProps.minWidth = null;
494
+ searchProps.maxWidth = undefined;
495
+ searchProps.minWidth = undefined;
494
496
  searchProps.autoFocus = true;
495
497
  searchProps.responsive = false;
496
498
  } else {
497
499
  searchProps.onSearch = this.handleStartSearching;
498
500
  }
499
501
  searchBlock = this.renderSearchBar(searchProps);
500
- } else if (addonBlock) {
502
+ } else if (addonElement) {
501
503
  searchProps.key = 1;
502
- addonBlock = [this.renderSearchBar(searchProps), /*#__PURE__*/cloneElement(addonBlock, {
503
- key: 2
504
- })];
504
+ addonBlock = /*#__PURE__*/_jsxs(_Fragment, {
505
+ children: [this.renderSearchBar(searchProps), /*#__PURE__*/cloneElement(addonElement, {
506
+ key: 2
507
+ })]
508
+ });
505
509
  } else {
506
510
  addonProps.style = {
507
511
  maxWidth: search.props.maxWidth
@@ -530,9 +534,10 @@ class Tabs extends Component {
530
534
  let {
531
535
  measureRef: ref
532
536
  } = _ref2;
533
- return /*#__PURE__*/cloneElement(this.renderFakeTabs(), {
537
+ const fakeTabs = this.renderFakeTabs();
538
+ return fakeTabs ? /*#__PURE__*/cloneElement(fakeTabs, {
534
539
  ref
535
- });
540
+ }) : null;
536
541
  }
537
542
  }), searchBlock, addonBlock && /*#__PURE__*/_jsx(Measure, {
538
543
  onResize: this.handleAddonResize,
@@ -560,62 +565,7 @@ class Tabs extends Component {
560
565
  });
561
566
  }
562
567
  }
563
- Tabs.propTypes = {
564
- /**
565
- * Number of active tab
566
- * @since 0.0.35
567
- */
568
- active: PropTypes.number,
569
- /**
570
- * Addon for search bar, dropdown etc.
571
- * @since 0.0.58
572
- */
573
- addon: PropTypes.element,
574
- /**
575
- * Placeholder for search bar, dropdown etc.
576
- *
577
- * @deprecated Do not use! Use `addon` instead!
578
- * @since 0.0.42
579
- */
580
- placeholder: PropTypes.element,
581
- /**
582
- * Minimum add-on width in pixels
583
- * @since 0.0.58
584
- */
585
- addonMinWidth: PropTypes.number,
586
- /**
587
- * Monospaced version of tabs (all visible tabs as wide as widest of them)
588
- * @since 0.0.58
589
- */
590
- monospaced: PropTypes.bool,
591
- /**
592
- * [SearchBar](#!/SearchBar) element
593
- * @since 0.0.58
594
- */
595
- search: PropTypes.element,
596
- /**
597
- * [Tabs](#!/Tab)
598
- * @since 0.0.47
599
- */
600
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element), PropTypes.element]),
601
- /**
602
- * @ignore
603
- */
604
- className: PropTypes.string,
605
- /**
606
- * @ignore
607
- */
608
- baseClassName: PropTypes.string
609
- };
610
- Tabs.defaultProps = {
611
- active: null,
612
- addon: null,
613
- placeholder: null,
614
- addonMinWidth: null,
615
- monospaced: null,
616
- search: null,
617
- children: null,
618
- className: null,
568
+ _defineProperty(Tabs, "defaultProps", {
619
569
  baseClassName: `${CLS_PREFIX}tabs`
620
- };
570
+ });
621
571
  export default Tabs;
@@ -15,6 +15,7 @@ class ToolbarItem extends Component {
15
15
  _defineProperty(this, "state", {
16
16
  compact: false
17
17
  });
18
+ _defineProperty(this, "context", void 0);
18
19
  }
19
20
  componentDidMount() {
20
21
  const registry = this.context;
@@ -85,8 +85,7 @@ export { default as Subnav, SubnavItem } from './Subnav';
85
85
  export { default as Switch } from './Switch';
86
86
  export { default as SwitchesPanel } from './SwitchesPanel';
87
87
  export { default as SwitchesPanelItem } from './SwitchesPanelItem';
88
- export { default as Tabs } from './Tabs';
89
- export * from './Tabs';
88
+ export { default as Tabs, Tab, SearchBar } from './Tabs';
90
89
  export { default as Text } from './Text';
91
90
  export { default as Toaster } from './Toaster';
92
91
  export { default as Toolbar, ToolbarGroup, ToolbarExpander } from './Toolbar';
package/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
2
2
  import svg4everybody from 'svg4everybody';
3
- const version = "3.35.6";
3
+ const version = "3.35.8";
4
4
  export * from './publicPath';
5
5
  export { version };
6
6
  export * from './utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plesk/ui-library",
3
- "version": "3.35.6",
3
+ "version": "3.35.8",
4
4
  "description": "Plesk UI Library",
5
5
  "main": "index.js",
6
6
  "module": "esm/index.js",
@@ -21,10 +21,12 @@
21
21
  "build:cjs": "cross-env NODE_ENV=cjs node ./scripts/build.js",
22
22
  "build:types": "rimraf ./types && tsc --project ./configs/types-generator.config.json",
23
23
  "create-svg-sprite": "node ./scripts/create-svg-sprite.js",
24
- "lint": "yarn lint:es && yarn lint:types && yarn lint:style",
24
+ "lint": "yarn lint:es && yarn lint:types && yarn lint:style && yarn format:check",
25
25
  "lint:es": "eslint --ext js,md,tsx src configs scripts styleguidist",
26
26
  "lint:types": "tsc",
27
27
  "lint:style": "stylelint \"{src,styleguidist}/**/*.less\"",
28
+ "format:check": "prettier --check src",
29
+ "format": "prettier --write src",
28
30
  "styleguide": "styleguidist server --config ./configs/styleguide.config.js",
29
31
  "styleguide:build": "styleguidist build --config ./configs/styleguide.config.js",
30
32
  "prepublishOnly": "yarn install && yarn test && yarn build && yarn styleguide:build",
@@ -69,57 +71,52 @@
69
71
  "@plesk/eslint-config": "^3.0.0",
70
72
  "@plesk/stylelint-config": "^2.0.0",
71
73
  "@testing-library/dom": "^9.3.3",
72
- "@testing-library/jest-dom": "^5.17.0",
73
- "@testing-library/react": "^12.1.5",
74
- "@testing-library/user-event": "^12.8.3",
74
+ "@testing-library/jest-dom": "^6.1.3",
75
+ "@testing-library/react": "^14.0.0",
76
+ "@testing-library/user-event": "^14.5.1",
75
77
  "@types/buble": "^0.20.2",
76
78
  "@types/classnames": "2.3.1",
77
79
  "@types/doctrine": "^0.0.5",
78
- "@types/enzyme": "^3.10.14",
79
- "@types/jest": "^28.1.8",
80
+ "@types/jest": "^29.5.5",
80
81
  "@types/jest-image-snapshot": "^6.2.1",
81
- "@types/marked": "^4.3.1",
82
- "@types/node": "^16.18.54",
83
- "@types/react": "^17.0.65",
84
- "@types/react-dom": "^17.0.20",
85
- "@types/react-measure": "2.0.8",
86
- "@types/react-transition-group": "^4.4.6",
82
+ "@types/marked": "^4.3.2",
83
+ "@types/node": "^16.18.58",
84
+ "@types/react": "^18.2.25",
85
+ "@types/react-dom": "^18.2.11",
86
+ "@types/react-measure": "2.0.9",
87
+ "@types/react-transition-group": "^4.4.7",
87
88
  "@types/svg4everybody": "2.1.2",
88
- "@typescript-eslint/eslint-plugin": "^5.62.0",
89
- "@typescript-eslint/parser": "^5.62.0",
90
- "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
89
+ "@typescript-eslint/eslint-plugin": "^6.7.4",
90
+ "@typescript-eslint/parser": "^6.7.4",
91
91
  "autoprefixer": "^10.4.16",
92
92
  "babel-loader": "^8.3.0",
93
93
  "babel-plugin-transform-require-ignore": "^0.1.1",
94
94
  "clean-webpack-plugin": "^4.0.0",
95
- "cross-env": "^5.2.1",
95
+ "cross-env": "^7.0.3",
96
96
  "css-loader": "^6.8.1",
97
97
  "css-minimizer-webpack-plugin": "^5.0.1",
98
- "enzyme": "^3.11.0",
99
- "enzyme-to-json": "^3.6.2",
100
- "eslint": "^8.50.0",
98
+ "eslint": "^8.51.0",
101
99
  "eslint-config-prettier": "^8.10.0",
102
100
  "eslint-plugin-markdown": "^3.0.1",
103
- "eslint-plugin-prettier": "^4.2.1",
104
101
  "html-webpack-plugin": "^5.5.3",
105
- "jest": "^28.1.3",
102
+ "jest": "^29.7.0",
106
103
  "jest-dev-server": "^9.0.1",
107
- "jest-environment-jsdom": "^28.1.3",
104
+ "jest-environment-jsdom": "^29.7.0",
108
105
  "jest-image-snapshot": "^6.2.0",
109
106
  "less": "^4.2.0",
110
107
  "less-loader": "^11.1.3",
111
108
  "mini-css-extract-plugin": "^2.7.6",
112
- "postcss": "^8.4.30",
109
+ "postcss": "^8.4.31",
113
110
  "postcss-less": "^6.0.0",
114
111
  "postcss-loader": "^7.3.3",
115
112
  "postcss-logical": "^6.2.0",
116
113
  "prettier": "^2.8.8",
117
114
  "puppeteer-core": "20.4.0",
118
- "react": "^17.0.2",
115
+ "react": "^18.2.0",
119
116
  "react-docgen-typescript": "^2.2.2",
120
- "react-dom": "^17.0.2",
121
- "react-styleguidist": "^12.0.1",
122
- "rimraf": "^5.0.1",
117
+ "react-dom": "^18.2.0",
118
+ "react-styleguidist": "^13.1.1",
119
+ "rimraf": "^5.0.5",
123
120
  "rtlcss": "^4.1.1",
124
121
  "style-loader": "^3.3.3",
125
122
  "stylelint": "^15.10.3",
@@ -129,17 +126,15 @@
129
126
  "stylelint-use-logical-spec": "^5.0.0",
130
127
  "svg-mixer": "^2.3.14",
131
128
  "terser-webpack-plugin": "^5.3.9",
132
- "typescript": "4.7.4",
129
+ "typescript": "5.2.2",
133
130
  "webpack": "^5.88.2",
134
131
  "webpack-cli": "^5.1.4"
135
132
  },
136
133
  "peerDependencies": {
137
- "react": "^17.0.2",
138
- "react-dom": "^17.0.2"
134
+ "react": "^18.2.0",
135
+ "react-dom": "^18.2.0"
139
136
  },
140
137
  "resolutions": {
141
- "@babel/types": "^7.15.6",
142
- "@types/react": "^17.0.39",
143
138
  "trim": ">=0.0.3",
144
139
  "postcss": "^8.4.23"
145
140
  },