@plesk/ui-library 3.39.0 → 3.40.1

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 (80) hide show
  1. package/cjs/components/Button/Button.js +4 -22
  2. package/cjs/components/Card/CardButton.js +2 -3
  3. package/cjs/components/CardList/CardListToolbar.js +3 -8
  4. package/cjs/components/Dialog/Dialog.js +5 -27
  5. package/cjs/components/Drawer/Drawer.js +7 -20
  6. package/cjs/components/Dropdown/Dropdown.js +3 -11
  7. package/cjs/components/FormField/FormField.js +13 -26
  8. package/cjs/components/List/List.js +1 -14
  9. package/cjs/components/Progress/Progress.js +6 -5
  10. package/cjs/components/ProgressStep/ProgressStep.js +5 -14
  11. package/cjs/components/ProgressStep/index.js +6 -0
  12. package/cjs/components/Section/Section.js +11 -19
  13. package/cjs/components/TextArea/TextArea.js +49 -97
  14. package/cjs/components/TextArea/calculateNodeHeight.js +8 -8
  15. package/cjs/components/Toolbar/RegistryContextBeta.js +112 -0
  16. package/cjs/components/Toolbar/Toolbar.js +46 -2
  17. package/cjs/components/Toolbar/ToolbarBetaProvider.js +23 -0
  18. package/cjs/components/Toolbar/ToolbarGroup.js +66 -4
  19. package/cjs/components/Toolbar/ToolbarItem.js +27 -12
  20. package/cjs/components/Toolbar/ToolbarMenu.js +2 -1
  21. package/cjs/components/Toolbar/index.js +8 -1
  22. package/cjs/components/index.js +15 -1
  23. package/cjs/hooks/index.js +12 -0
  24. package/cjs/hooks/useResizeObserver.js +29 -0
  25. package/cjs/hooks/useSqueeze.js +48 -0
  26. package/cjs/index.js +1 -1
  27. package/dist/plesk-ui-library.js +586 -303
  28. package/dist/plesk-ui-library.js.map +1 -1
  29. package/dist/plesk-ui-library.min.js +6 -6
  30. package/dist/plesk-ui-library.min.js.map +1 -1
  31. package/esm/components/Button/Button.js +3 -21
  32. package/esm/components/Card/CardButton.js +2 -3
  33. package/esm/components/CardList/CardListToolbar.js +3 -8
  34. package/esm/components/Dialog/Dialog.js +5 -27
  35. package/esm/components/Drawer/Drawer.js +7 -20
  36. package/esm/components/Dropdown/Dropdown.js +3 -11
  37. package/esm/components/FormField/FormField.js +13 -26
  38. package/esm/components/List/List.js +1 -14
  39. package/esm/components/Progress/Progress.js +7 -6
  40. package/esm/components/ProgressStep/ProgressStep.js +4 -13
  41. package/esm/components/ProgressStep/index.js +1 -1
  42. package/esm/components/Section/Section.js +11 -19
  43. package/esm/components/TextArea/TextArea.js +50 -98
  44. package/esm/components/TextArea/calculateNodeHeight.js +8 -8
  45. package/esm/components/Toolbar/RegistryContextBeta.js +103 -0
  46. package/esm/components/Toolbar/Toolbar.js +47 -3
  47. package/esm/components/Toolbar/ToolbarBetaProvider.js +16 -0
  48. package/esm/components/Toolbar/ToolbarGroup.js +67 -5
  49. package/esm/components/Toolbar/ToolbarItem.js +27 -12
  50. package/esm/components/Toolbar/ToolbarMenu.js +2 -1
  51. package/esm/components/Toolbar/index.js +2 -1
  52. package/esm/components/index.js +2 -2
  53. package/esm/hooks/index.js +3 -0
  54. package/esm/hooks/useResizeObserver.js +22 -0
  55. package/esm/hooks/useSqueeze.js +41 -0
  56. package/esm/index.js +1 -1
  57. package/package.json +10 -10
  58. package/styleguide/build/bundle.505bc865.js +2 -0
  59. package/styleguide/index.html +2 -2
  60. package/types/src/components/Button/Button.d.ts +1 -0
  61. package/types/src/components/Dialog/Dialog.d.ts +1 -25
  62. package/types/src/components/Drawer/Drawer.d.ts +2 -5
  63. package/types/src/components/FormField/FormField.d.ts +1 -23
  64. package/types/src/components/ProgressStep/ProgressStep.d.ts +2 -13
  65. package/types/src/components/ProgressStep/index.d.ts +1 -1
  66. package/types/src/components/Section/Section.d.ts +2 -32
  67. package/types/src/components/TextArea/TextArea.d.ts +5 -32
  68. package/types/src/components/TextArea/calculateNodeHeight.d.ts +2 -6
  69. package/types/src/components/Toolbar/RegistryContextBeta.d.ts +25 -0
  70. package/types/src/components/Toolbar/Toolbar.d.ts +2 -22
  71. package/types/src/components/Toolbar/ToolbarBetaProvider.d.ts +5 -0
  72. package/types/src/components/Toolbar/ToolbarGroup.d.ts +2 -5
  73. package/types/src/components/Toolbar/ToolbarItem.d.ts +1 -1
  74. package/types/src/components/Toolbar/index.d.ts +1 -0
  75. package/types/src/components/index.d.ts +2 -2
  76. package/types/src/hooks/index.d.ts +1 -0
  77. package/types/src/hooks/useResizeObserver.d.ts +7 -0
  78. package/types/src/hooks/useSqueeze.d.ts +10 -0
  79. package/styleguide/build/bundle.c34e3753.js +0 -2
  80. /package/styleguide/build/{bundle.c34e3753.js.LICENSE.txt → bundle.505bc865.js.LICENSE.txt} +0 -0
@@ -1299,7 +1299,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
1299
1299
  Object.defineProperty(exports, "__esModule", ({
1300
1300
  value: true
1301
1301
  }));
1302
- exports["default"] = void 0;
1302
+ exports["default"] = exports.BUTTON_PROP_NAMES = void 0;
1303
1303
  var _react = __webpack_require__(/*! react */ "react");
1304
1304
  var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "../node_modules/classnames/index.js"));
1305
1305
  var _constants = __webpack_require__(/*! ../../constants */ "./constants.js");
@@ -1350,6 +1350,9 @@ const renderCaret = _ref2 => {
1350
1350
  }
1351
1351
  return caretElement;
1352
1352
  };
1353
+
1354
+ // For ToolbarMenu backward compatibility purposes
1355
+ const BUTTON_PROP_NAMES = exports.BUTTON_PROP_NAMES = ['size', 'intent', 'ghost', 'selected', 'onToggle', 'state', 'disabled', 'tooltip', 'icon', 'caret', 'fill', 'children', 'component', 'className', 'baseClassName', 'arrow', 'onClick'];
1353
1356
  const Button = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
1354
1357
  let {
1355
1358
  baseClassName = `${_constants.CLS_PREFIX}button`,
@@ -1463,27 +1466,6 @@ const Button = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
1463
1466
  });
1464
1467
  Button.displayName = 'Button';
1465
1468
 
1466
- // For ToolbarMenu backward compatibility purposes
1467
- Button.defaultProps = {
1468
- size: undefined,
1469
- intent: undefined,
1470
- ghost: false,
1471
- selected: undefined,
1472
- onToggle: undefined,
1473
- state: undefined,
1474
- disabled: false,
1475
- tooltip: undefined,
1476
- icon: undefined,
1477
- caret: undefined,
1478
- fill: false,
1479
- children: undefined,
1480
- component: 'button',
1481
- className: undefined,
1482
- baseClassName: `${_constants.CLS_PREFIX}button`,
1483
- arrow: undefined,
1484
- onClick: undefined
1485
- };
1486
-
1487
1469
  /**
1488
1470
  * `Button` component is used for executing actions, changing the application state, opening forms or dialog windows, and submitting data.
1489
1471
  * As a rule, you should not use buttons for navigation between individual pages (use `Link` instead).
@@ -2135,10 +2117,12 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
2135
2117
  const CardButton = _ref => {
2136
2118
  let {
2137
2119
  icon,
2120
+ baseClassName = `${_constants.CLS_PREFIX}card-button`,
2138
2121
  ...props
2139
2122
  } = _ref;
2140
2123
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
2141
2124
  icon: _Icon.default.create(icon),
2125
+ baseClassName: baseClassName,
2142
2126
  ...props
2143
2127
  });
2144
2128
  };
@@ -2149,9 +2133,6 @@ CardButton.propTypes = {
2149
2133
  baseClassName: _propTypes.default.string,
2150
2134
  icon: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.element]).isRequired
2151
2135
  };
2152
- CardButton.defaultProps = {
2153
- baseClassName: `${_constants.CLS_PREFIX}card-button`
2154
- };
2155
2136
  var _default = exports["default"] = CardButton;
2156
2137
 
2157
2138
  /***/ }),
@@ -2954,9 +2935,9 @@ const renderView = (onViewChange, currentView) => {
2954
2935
  const isToolbarExpander = element => /*#__PURE__*/(0, _react.isValidElement)(element) && element.type === _Toolbar.ToolbarExpander;
2955
2936
  const CardListToolbar = _ref2 => {
2956
2937
  let {
2957
- baseClassName,
2958
- selection,
2959
- onViewChange,
2938
+ baseClassName = `${_constants.CLS_PREFIX}card-list__toolbar`,
2939
+ selection = null,
2940
+ onViewChange = null,
2960
2941
  currentView,
2961
2942
  groups
2962
2943
  } = _ref2;
@@ -2987,11 +2968,6 @@ CardListToolbar.propTypes = {
2987
2968
  currentView: _propTypes.default.string.isRequired,
2988
2969
  baseClassName: _propTypes.default.string
2989
2970
  };
2990
- CardListToolbar.defaultProps = {
2991
- selection: null,
2992
- onViewChange: null,
2993
- baseClassName: `${_constants.CLS_PREFIX}card-list__toolbar`
2994
- };
2995
2971
  var _default = exports["default"] = CardListToolbar;
2996
2972
 
2997
2973
  /***/ }),
@@ -5154,11 +5130,14 @@ const isProps = value => value && typeof value === 'object' && ! /*#__PURE__*/(0
5154
5130
  */
5155
5131
  const Dialog = _ref => {
5156
5132
  let {
5157
- baseClassName,
5133
+ baseClassName = `${_constants.CLS_PREFIX}dialog`,
5134
+ isOpen = false,
5135
+ size = 'md',
5136
+ closable = true,
5137
+ canClose = true,
5158
5138
  className,
5159
5139
  children,
5160
5140
  actions,
5161
- isOpen,
5162
5141
  banner,
5163
5142
  image,
5164
5143
  title,
@@ -5167,11 +5146,8 @@ const Dialog = _ref => {
5167
5146
  cancelButton,
5168
5147
  buttons,
5169
5148
  form,
5170
- size,
5171
- closable,
5172
5149
  onClose,
5173
5150
  closingConfirmation,
5174
- canClose,
5175
5151
  ...props
5176
5152
  } = _ref;
5177
5153
  const [isVisible, setIsVisible] = (0, _react.useState)(isOpen);
@@ -5331,28 +5307,6 @@ const Dialog = _ref => {
5331
5307
  }), closingConfirmationDialog]
5332
5308
  });
5333
5309
  };
5334
- Dialog.defaultProps = {
5335
- isOpen: false,
5336
- banner: undefined,
5337
- sideBanner: undefined,
5338
- sideBannerContainer: undefined,
5339
- image: undefined,
5340
- title: undefined,
5341
- subtitle: undefined,
5342
- cancelTitle: undefined,
5343
- cancelButton: undefined,
5344
- buttons: undefined,
5345
- actions: undefined,
5346
- form: undefined,
5347
- size: 'md',
5348
- closable: true,
5349
- canClose: true,
5350
- onClose: undefined,
5351
- closingConfirmation: undefined,
5352
- children: undefined,
5353
- className: undefined,
5354
- baseClassName: `${_constants.CLS_PREFIX}dialog`
5355
- };
5356
5310
  var _default = exports["default"] = Dialog;
5357
5311
 
5358
5312
  /***/ }),
@@ -5455,24 +5409,6 @@ var _jsxRuntime = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/
5455
5409
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5456
5410
  // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
5457
5411
 
5458
- const defaultProps = {
5459
- isOpen: false,
5460
- subtitle: undefined,
5461
- backButton: undefined,
5462
- hideButton: undefined,
5463
- tabs: undefined,
5464
- placement: 'left',
5465
- size: 'md',
5466
- onClose: undefined,
5467
- closingConfirmation: undefined,
5468
- form: undefined,
5469
- sideBanner: undefined,
5470
- sideBannerContainer: undefined,
5471
- progress: undefined,
5472
- children: null,
5473
- className: undefined,
5474
- baseClassName: `${_constants.CLS_PREFIX}drawer`
5475
- };
5476
5412
  /**
5477
5413
  * `Drawer` component is used for working with properties of an object (or system) without leaving the context of the object.
5478
5414
  * [Read more when to use Drawer](#!/Drawers%2C%20pages%2C%20popovers).
@@ -5480,7 +5416,10 @@ const defaultProps = {
5480
5416
  */
5481
5417
  const Drawer = _ref => {
5482
5418
  let {
5483
- baseClassName,
5419
+ baseClassName = `${_constants.CLS_PREFIX}drawer`,
5420
+ isOpen = false,
5421
+ placement = 'left',
5422
+ size = 'md',
5484
5423
  className,
5485
5424
  children,
5486
5425
  title,
@@ -5582,6 +5521,9 @@ const Drawer = _ref => {
5582
5521
  }, className),
5583
5522
  onClose: onCloseWithConfirmation,
5584
5523
  canCloseOnBackdropClick: true,
5524
+ isOpen: isOpen,
5525
+ placement: placement,
5526
+ size: size,
5585
5527
  ...props,
5586
5528
  children: [takeApart(_ref5 => {
5587
5529
  let {
@@ -5623,7 +5565,6 @@ const Drawer = _ref => {
5623
5565
  }), closingConfirmationDialog]
5624
5566
  });
5625
5567
  };
5626
- Drawer.defaultProps = defaultProps;
5627
5568
  var _default = exports["default"] = Drawer;
5628
5569
 
5629
5570
  /***/ }),
@@ -6077,12 +6018,12 @@ const useEnhancedMenu = (menu, _ref2) => {
6077
6018
  */
6078
6019
  const Dropdown = _ref3 => {
6079
6020
  let {
6080
- baseClassName,
6021
+ baseClassName = `${_constants.CLS_PREFIX}dropdown`,
6081
6022
  className,
6082
6023
  children,
6083
6024
  menu,
6084
- menuPlacement,
6085
- overlay,
6025
+ menuPlacement = 'bottom-start',
6026
+ overlay = false,
6086
6027
  locale,
6087
6028
  ...props
6088
6029
  } = _ref3;
@@ -6151,14 +6092,6 @@ const Dropdown = _ref3 => {
6151
6092
  })
6152
6093
  });
6153
6094
  };
6154
- Dropdown.defaultProps = {
6155
- menuPlacement: 'bottom-start',
6156
- children: undefined,
6157
- overlay: false,
6158
- className: undefined,
6159
- baseClassName: `${_constants.CLS_PREFIX}dropdown`,
6160
- locale: undefined
6161
- };
6162
6095
  var _default = exports["default"] = Dropdown;
6163
6096
 
6164
6097
  /***/ }),
@@ -7404,28 +7337,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
7404
7337
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
7405
7338
  const BASE_FORM_FIELD_CLASS_NAME = exports.BASE_FORM_FIELD_CLASS_NAME = `${_constants.CLS_PREFIX}form-field`;
7406
7339
  const defaultValue = undefined;
7407
- const defaultProps = {
7408
- id: undefined,
7409
- name: undefined,
7410
- value: defaultValue,
7411
- onChange: null,
7412
- label: undefined,
7413
- description: undefined,
7414
- errors: {},
7415
- required: false,
7416
- children: undefined,
7417
- multi: undefined,
7418
- disabled: undefined,
7419
- locale: undefined,
7420
- addMoreValidator: undefined,
7421
- onRemoveRow: null,
7422
- fullDescription: undefined,
7423
- className: undefined,
7424
- baseClassName: BASE_FORM_FIELD_CLASS_NAME,
7425
- form: undefined,
7426
- vertical: undefined,
7427
- scrollableElement: undefined
7428
- };
7429
7340
 
7430
7341
  /**
7431
7342
  * Simple helper to handle situations when we're expecting only array
@@ -7831,8 +7742,14 @@ class FormField extends _react.Component {
7831
7742
  * * [FormFieldSelect](#!/FormFieldSelect), [FormFieldCheckbox](#!/FormFieldCheckbox),
7832
7743
  * [FormFieldRadioButtons](#!/FormFieldRadioButtons) for selecting options.
7833
7744
  */
7834
- _defineProperty(FormField, "defaultProps", defaultProps);
7835
- const FormFieldWrapper = props => {
7745
+ const FormFieldWrapper = _ref => {
7746
+ let {
7747
+ value = defaultValue,
7748
+ errors = {},
7749
+ required = false,
7750
+ baseClassName = BASE_FORM_FIELD_CLASS_NAME,
7751
+ ...props
7752
+ } = _ref;
7836
7753
  const form = (0, _react.useContext)(_FormContext.default);
7837
7754
  const verticalContext = (0, _react.useContext)(_VerticalContext.default);
7838
7755
  const vertical = props.vertical === undefined ? verticalContext : props.vertical;
@@ -7843,11 +7760,14 @@ const FormFieldWrapper = props => {
7843
7760
  form: form,
7844
7761
  vertical: vertical,
7845
7762
  scrollableElement: scrollableElement,
7846
- disabled: props.disabled || disabled
7763
+ disabled: props.disabled || disabled,
7764
+ value: value,
7765
+ errors: errors,
7766
+ required: required,
7767
+ baseClassName: baseClassName
7847
7768
  });
7848
7769
  };
7849
7770
  FormFieldWrapper.displayName = 'FormField';
7850
- FormFieldWrapper.defaultProps = defaultProps;
7851
7771
  var _default = exports["default"] = FormFieldWrapper;
7852
7772
 
7853
7773
  /***/ }),
@@ -11565,7 +11485,6 @@ Object.defineProperty(exports, "__esModule", ({
11565
11485
  }));
11566
11486
  exports["default"] = void 0;
11567
11487
  var _react = __webpack_require__(/*! react */ "react");
11568
- var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"));
11569
11488
  var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "../node_modules/classnames/index.js"));
11570
11489
  var _reactTransitionGroup = __webpack_require__(/*! react-transition-group */ "../node_modules/react-transition-group/esm/index.js");
11571
11490
  var _memoizeOne = _interopRequireDefault(__webpack_require__(/*! memoize-one */ "../node_modules/memoize-one/dist/memoize-one.esm.js"));
@@ -11604,7 +11523,7 @@ function getRowKey(row, props) {
11604
11523
  }
11605
11524
  const Tbody = _ref => {
11606
11525
  let {
11607
- baseClassName,
11526
+ baseClassName = `${_constants.CLS_PREFIX}list__wrapper`,
11608
11527
  className,
11609
11528
  ...props
11610
11529
  } = _ref;
@@ -11622,18 +11541,6 @@ const Tbody = _ref => {
11622
11541
  })
11623
11542
  });
11624
11543
  };
11625
- Tbody.propTypes = {
11626
- onFocus: _propTypes.default.func,
11627
- onBlur: _propTypes.default.func,
11628
- className: _propTypes.default.string,
11629
- baseClassName: _propTypes.default.string
11630
- };
11631
- Tbody.defaultProps = {
11632
- onFocus: undefined,
11633
- onBlur: undefined,
11634
- className: undefined,
11635
- baseClassName: `${_constants.CLS_PREFIX}list__wrapper`
11636
- };
11637
11544
  const getHumanTotalRows = _ref2 => {
11638
11545
  let {
11639
11546
  selectedRows,
@@ -15815,11 +15722,12 @@ class Progress extends _react.Component {
15815
15722
  let isFailed = false;
15816
15723
  if (children) {
15817
15724
  _react.Children.forEach(children, child => {
15818
- if ( /*#__PURE__*/(0, _react.isValidElement)(child) && child.props.status) {
15819
- isNotStarted = isNotStarted && child.props.status === _ProgressStep.STATUS_NOT_STARTED;
15820
- isFinished = isFinished && child.props.status === _ProgressStep.STATUS_DONE;
15821
- isFinishedWithWarnings = isFinishedWithWarnings && [_ProgressStep.STATUS_DONE, _ProgressStep.STATUS_WARNING].includes(child.props.status);
15822
- isFailed = isFailed || child.props.status === _ProgressStep.STATUS_ERROR;
15725
+ if ( /*#__PURE__*/(0, _react.isValidElement)(child)) {
15726
+ const status = child.props.status ?? _ProgressStep.PROGRESS_STEP_DEFAULT_STATUS;
15727
+ isNotStarted = isNotStarted && status === _ProgressStep.STATUS_NOT_STARTED;
15728
+ isFinished = isFinished && status === _ProgressStep.STATUS_DONE;
15729
+ isFinishedWithWarnings = isFinishedWithWarnings && [_ProgressStep.STATUS_DONE, _ProgressStep.STATUS_WARNING].includes(status);
15730
+ isFailed = isFailed || status === _ProgressStep.STATUS_ERROR;
15823
15731
  }
15824
15732
  });
15825
15733
  }
@@ -16310,7 +16218,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
16310
16218
  Object.defineProperty(exports, "__esModule", ({
16311
16219
  value: true
16312
16220
  }));
16313
- exports["default"] = exports.STATUS_WARNING = exports.STATUS_RUNNING = exports.STATUS_NOT_STARTED = exports.STATUS_ERROR = exports.STATUS_DONE = exports.STATUS_CANCELED = void 0;
16221
+ exports["default"] = exports.STATUS_WARNING = exports.STATUS_RUNNING = exports.STATUS_NOT_STARTED = exports.STATUS_ERROR = exports.STATUS_DONE = exports.STATUS_CANCELED = exports.PROGRESS_STEP_DEFAULT_STATUS = void 0;
16314
16222
  var _react = __webpack_require__(/*! react */ "react");
16315
16223
  var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "../node_modules/classnames/index.js"));
16316
16224
  var _Icon = _interopRequireWildcard(__webpack_require__(/*! ../Icon */ "./components/Icon/index.tsx"));
@@ -16332,6 +16240,7 @@ const STATUS_DONE = exports.STATUS_DONE = 'done';
16332
16240
  const STATUS_WARNING = exports.STATUS_WARNING = 'warning';
16333
16241
  const STATUS_ERROR = exports.STATUS_ERROR = 'error';
16334
16242
  const STATUS_CANCELED = exports.STATUS_CANCELED = 'canceled';
16243
+ const PROGRESS_STEP_DEFAULT_STATUS = exports.PROGRESS_STEP_DEFAULT_STATUS = STATUS_NOT_STARTED;
16335
16244
  /**
16336
16245
  * `ProgressStep` is a part of the [Progress](#!/Progress) component.
16337
16246
  * @since 1.10.0
@@ -16343,9 +16252,9 @@ const ProgressStep = _ref => {
16343
16252
  icon,
16344
16253
  title,
16345
16254
  statusText,
16346
- progress,
16347
- status,
16348
- baseClassName,
16255
+ progress = -1,
16256
+ status = PROGRESS_STEP_DEFAULT_STATUS,
16257
+ baseClassName = `${_constants.CLS_PREFIX}progress-step`,
16349
16258
  ...props
16350
16259
  } = _ref;
16351
16260
  let intent = null;
@@ -16421,16 +16330,6 @@ const ProgressStep = _ref => {
16421
16330
  })]
16422
16331
  });
16423
16332
  };
16424
- ProgressStep.defaultProps = {
16425
- icon: null,
16426
- title: null,
16427
- status: STATUS_NOT_STARTED,
16428
- statusText: null,
16429
- progress: -1,
16430
- children: null,
16431
- className: null,
16432
- baseClassName: `${_constants.CLS_PREFIX}progress-step`
16433
- };
16434
16333
  var _default = exports["default"] = ProgressStep;
16435
16334
 
16436
16335
  /***/ }),
@@ -16447,6 +16346,12 @@ var _default = exports["default"] = ProgressStep;
16447
16346
  Object.defineProperty(exports, "__esModule", ({
16448
16347
  value: true
16449
16348
  }));
16349
+ Object.defineProperty(exports, "PROGRESS_STEP_DEFAULT_STATUS", ({
16350
+ enumerable: true,
16351
+ get: function () {
16352
+ return _ProgressStep.PROGRESS_STEP_DEFAULT_STATUS;
16353
+ }
16354
+ }));
16450
16355
  Object.defineProperty(exports, "STATUS_CANCELED", ({
16451
16356
  enumerable: true,
16452
16357
  get: function () {
@@ -16770,21 +16675,6 @@ const getErrorsForChildren = (form, children) => {
16770
16675
  return errors;
16771
16676
  };
16772
16677
  const SECTION_BASE_CLASS_NAME = exports.SECTION_BASE_CLASS_NAME = `${_constants.CLS_PREFIX}section`;
16773
- const DEFAULT_PROPS = {
16774
- title: undefined,
16775
- intent: undefined,
16776
- collapsible: false,
16777
- collapsed: false,
16778
- onTitleChange: undefined,
16779
- onClose: undefined,
16780
- onToggle: undefined,
16781
- buttons: undefined,
16782
- vertical: undefined,
16783
- children: undefined,
16784
- className: undefined,
16785
- baseClassName: SECTION_BASE_CLASS_NAME,
16786
- form: undefined
16787
- };
16788
16678
  class Section extends _react.Component {
16789
16679
  constructor() {
16790
16680
  super(...arguments);
@@ -16972,19 +16862,26 @@ class Section extends _react.Component {
16972
16862
  * and comprehension of the presented information.
16973
16863
  * @since 0.0.54
16974
16864
  */
16975
- _defineProperty(Section, "defaultProps", DEFAULT_PROPS);
16976
- const SectionWrapper = props => {
16865
+ const SectionWrapper = _ref8 => {
16866
+ let {
16867
+ collapsible = false,
16868
+ collapsed = false,
16869
+ baseClassName = SECTION_BASE_CLASS_NAME,
16870
+ ...props
16871
+ } = _ref8;
16977
16872
  const form = (0, _react.useContext)(_FormContext.default);
16978
16873
  const verticalContext = (0, _react.useContext)(_VerticalContext.default);
16979
16874
  const vertical = props.vertical === undefined ? verticalContext : props.vertical;
16980
16875
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Section, {
16981
16876
  ...props,
16982
16877
  form: form,
16983
- vertical: vertical
16878
+ vertical: vertical,
16879
+ collapsible: collapsible,
16880
+ collapsed: collapsed,
16881
+ baseClassName: baseClassName
16984
16882
  });
16985
16883
  };
16986
16884
  SectionWrapper.displayName = 'Section';
16987
- SectionWrapper.defaultProps = DEFAULT_PROPS;
16988
16885
  SectionWrapper.WrappedComponent = Section;
16989
16886
  var _default = exports["default"] = SectionWrapper;
16990
16887
 
@@ -20880,9 +20777,8 @@ var _calculateNodeHeight = _interopRequireDefault(__webpack_require__(/*! ./calc
20880
20777
  __webpack_require__(/*! ./TextArea.less */ "./components/TextArea/TextArea.less");
20881
20778
  var _jsxRuntime = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
20882
20779
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20883
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
20884
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
20885
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
20780
+ // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
20781
+
20886
20782
  const getMinMax = rows => {
20887
20783
  if (typeof rows === 'number') {
20888
20784
  return {
@@ -20894,111 +20790,64 @@ const getMinMax = rows => {
20894
20790
  maxRows: rows.max
20895
20791
  };
20896
20792
  }
20897
- return null;
20793
+ return {};
20898
20794
  };
20899
- const AVAILABLE_SIZES = ['sm', 'md', 'lg', 'xl', 'fill'];
20795
+ const AVAILABLE_SIZES = new Set(['sm', 'md', 'lg', 'xl', 'fill']);
20900
20796
 
20901
20797
  /**
20902
20798
  * `TextArea` is used for entering long text (like email body, descriptions, comments).
20903
20799
  * @since 1.9.0
20904
20800
  */
20905
-
20906
- class TextArea extends _react.Component {
20907
- constructor() {
20908
- super(...arguments);
20909
- _defineProperty(this, "state", {
20910
- textareaStyles: null
20911
- });
20912
- _defineProperty(this, "rootRef", /*#__PURE__*/(0, _react.createRef)());
20913
- _defineProperty(this, "handleChange", e => {
20914
- const {
20915
- autoheight,
20916
- onChange
20917
- } = this.props;
20918
- if (autoheight) {
20919
- this.adjustHeight();
20920
- }
20921
- if (typeof onChange === 'function') {
20922
- onChange(e);
20923
- }
20924
- });
20925
- }
20926
- static getDerivedStateFromProps(_ref) {
20927
- let {
20928
- rows
20929
- } = _ref;
20930
- if (rows) {
20931
- return getMinMax(rows);
20932
- }
20933
- return null;
20934
- }
20935
- componentDidMount() {
20936
- this.adjustHeight();
20937
- }
20938
- componentDidUpdate(prevProps) {
20939
- const {
20940
- autoheight
20941
- } = this.props;
20942
- if (autoheight !== prevProps.autoheight) {
20943
- this.adjustHeight();
20944
- }
20945
- }
20946
- adjustHeight() {
20947
- const {
20948
- autoheight
20949
- } = this.props;
20950
- if (!autoheight) {
20951
- this.setState({
20952
- textareaStyles: null
20953
- });
20801
+ const TextArea = _ref => {
20802
+ let {
20803
+ baseClassName = `${_constants.CLS_PREFIX}textarea`,
20804
+ className,
20805
+ rows = 4,
20806
+ size = 'md',
20807
+ autoheight = false,
20808
+ onChange,
20809
+ style,
20810
+ ...props
20811
+ } = _ref;
20812
+ const rootRef = (0, _react.useRef)(null);
20813
+ const useSizeModifier = size && AVAILABLE_SIZES.has(size);
20814
+ const {
20815
+ minRows,
20816
+ maxRows
20817
+ } = getMinMax(rows);
20818
+ const [heightStyle, setHeightStyle] = (0, _react.useState)();
20819
+ const adjustHeight = (0, _react.useCallback)(() => {
20820
+ if (!autoheight || !rootRef.current) {
20821
+ setHeightStyle(undefined);
20954
20822
  return;
20955
20823
  }
20956
- const {
20957
- minRows,
20958
- maxRows
20959
- } = this.state;
20960
- if (this.rootRef.current) {
20961
- const textareaStyles = (0, _calculateNodeHeight.default)(this.rootRef.current, false, minRows, maxRows);
20962
- this.setState({
20963
- textareaStyles
20964
- });
20824
+ setHeightStyle((0, _calculateNodeHeight.default)(rootRef.current, false, minRows, maxRows));
20825
+ }, [autoheight, maxRows, minRows]);
20826
+ (0, _react.useLayoutEffect)(() => {
20827
+ adjustHeight();
20828
+ }, [adjustHeight]);
20829
+ const handleChange = e => {
20830
+ if (autoheight) {
20831
+ adjustHeight();
20965
20832
  }
20966
- }
20967
- render() {
20968
- const {
20969
- baseClassName,
20970
- className,
20971
- rows,
20972
- size,
20973
- autoheight,
20974
- onChange,
20975
- ...other
20976
- } = this.props;
20977
- const {
20978
- textareaStyles,
20979
- minRows
20980
- } = this.state;
20981
- const useSizeModifier = size && AVAILABLE_SIZES.indexOf(size) !== -1;
20982
- return /*#__PURE__*/(0, _jsxRuntime.jsx)("textarea", {
20983
- className: (0, _classnames.default)(baseClassName, {
20984
- [`${baseClassName}--size-${size}`]: useSizeModifier
20985
- }, className),
20986
- ref: this.rootRef,
20987
- style: textareaStyles,
20988
- onChange: this.handleChange,
20989
- rows: minRows,
20990
- ...other
20991
- });
20992
- }
20993
- }
20994
- _defineProperty(TextArea, "defaultProps", {
20995
- baseClassName: `${_constants.CLS_PREFIX}textarea`,
20996
- className: null,
20997
- rows: 4,
20998
- size: 'md',
20999
- autoheight: false,
21000
- onChange: null
21001
- });
20833
+ if (typeof onChange === 'function') {
20834
+ onChange(e);
20835
+ }
20836
+ };
20837
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("textarea", {
20838
+ ref: rootRef,
20839
+ className: (0, _classnames.default)(baseClassName, {
20840
+ [`${baseClassName}--size-${size}`]: useSizeModifier
20841
+ }, className),
20842
+ style: {
20843
+ ...style,
20844
+ ...heightStyle
20845
+ },
20846
+ onChange: handleChange,
20847
+ rows: minRows,
20848
+ ...props
20849
+ });
20850
+ };
21002
20851
  var _default = exports["default"] = TextArea;
21003
20852
 
21004
20853
  /***/ }),
@@ -21059,8 +20908,8 @@ const calculateNodeStyling = function (node) {
21059
20908
  // eslint-disable-next-line max-params
21060
20909
  function calculateNodeHeight(uiTextNode) {
21061
20910
  let useCache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
21062
- let minRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
21063
- let maxRows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
20911
+ let minRows = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
20912
+ let maxRows = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
21064
20913
  if (!hiddenTextarea) {
21065
20914
  hiddenTextarea = document.createElement('textarea');
21066
20915
  document.body.appendChild(hiddenTextarea);
@@ -21082,8 +20931,8 @@ function calculateNodeHeight(uiTextNode) {
21082
20931
  // Need to have the overflow attribute to hide the scrollbar otherwise text-lines will not calculated properly as the shadow will technically be narrower for content
21083
20932
  hiddenTextarea.setAttribute('style', `${sizingStyle};${HIDDEN_TEXTAREA_STYLE}`);
21084
20933
  hiddenTextarea.value = uiTextNode.value || uiTextNode.placeholder || '';
21085
- let minHeight = null;
21086
- let maxHeight = null;
20934
+ let minHeight = undefined;
20935
+ let maxHeight = undefined;
21087
20936
  let height = hiddenTextarea.scrollHeight;
21088
20937
  let overflowY;
21089
20938
  if (boxSizing === 'border-box') {
@@ -21093,23 +20942,23 @@ function calculateNodeHeight(uiTextNode) {
21093
20942
  // remove padding, since height = content
21094
20943
  height = height - paddingSize;
21095
20944
  }
21096
- if (minRows !== null || maxRows !== null) {
20945
+ if (minRows !== undefined || maxRows !== undefined) {
21097
20946
  // measure height of a textarea with a single row
21098
20947
  hiddenTextarea.value = ' ';
21099
20948
  const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
21100
- if (minRows !== null) {
20949
+ if (minRows !== undefined) {
21101
20950
  minHeight = singleRowHeight * minRows;
21102
20951
  if (boxSizing === 'border-box') {
21103
20952
  minHeight = minHeight + paddingSize + borderSize;
21104
20953
  }
21105
20954
  height = Math.max(minHeight, height);
21106
20955
  }
21107
- if (maxRows !== null) {
20956
+ if (maxRows !== undefined) {
21108
20957
  maxHeight = singleRowHeight * maxRows;
21109
20958
  if (boxSizing === 'border-box') {
21110
20959
  maxHeight = maxHeight + paddingSize + borderSize;
21111
20960
  }
21112
- overflowY = height > maxHeight ? '' : 'hidden';
20961
+ overflowY = height > maxHeight ? undefined : 'hidden';
21113
20962
  height = Math.min(maxHeight, height);
21114
20963
  }
21115
20964
  }
@@ -21605,6 +21454,127 @@ exports.createRegistry = createRegistry;
21605
21454
 
21606
21455
  /***/ }),
21607
21456
 
21457
+ /***/ "./components/Toolbar/RegistryContextBeta.tsx":
21458
+ /*!****************************************************!*\
21459
+ !*** ./components/Toolbar/RegistryContextBeta.tsx ***!
21460
+ \****************************************************/
21461
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
21462
+
21463
+ "use strict";
21464
+
21465
+
21466
+ Object.defineProperty(exports, "__esModule", ({
21467
+ value: true
21468
+ }));
21469
+ exports.useRegistryItem = exports.useRegistry = exports["default"] = void 0;
21470
+ var _react = __webpack_require__(/*! react */ "react");
21471
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21472
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
21473
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
21474
+ const RegistryContext = /*#__PURE__*/(0, _react.createContext)(undefined);
21475
+ RegistryContext.displayName = 'RegistryContext';
21476
+ const useRegistryContext = () => (0, _react.useContext)(RegistryContext);
21477
+ var _default = exports["default"] = RegistryContext;
21478
+ class Registry {
21479
+ constructor() {
21480
+ _defineProperty(this, "items", []);
21481
+ }
21482
+ register(item) {
21483
+ this.items.push(item);
21484
+ }
21485
+ unregister(item) {
21486
+ this.items = this.items.filter(i => i !== item);
21487
+ }
21488
+ compact() {
21489
+ let changed = false;
21490
+ for (const item of [...this.items].reverse()) {
21491
+ if (!item.isCompact) {
21492
+ item.compact();
21493
+ changed = true;
21494
+ break;
21495
+ }
21496
+ }
21497
+ return changed;
21498
+ }
21499
+ expand() {
21500
+ let changed = false;
21501
+ for (const item of this.items) {
21502
+ if (this.checkItemIsCompactOrHasCompactItems(item)) {
21503
+ item.expand();
21504
+ changed = true;
21505
+ break;
21506
+ }
21507
+ }
21508
+ return changed;
21509
+ }
21510
+ get isCompact() {
21511
+ return this.items.every(_ref => {
21512
+ let {
21513
+ isCompact
21514
+ } = _ref;
21515
+ return isCompact;
21516
+ });
21517
+ }
21518
+ get hasCompactItems() {
21519
+ return this.items.some(this.checkItemIsCompactOrHasCompactItems);
21520
+ }
21521
+ checkItemIsCompactOrHasCompactItems(item) {
21522
+ return item.isCompact || 'hasCompactItems' in item && item.hasCompactItems;
21523
+ }
21524
+ }
21525
+ class RegistryItem {
21526
+ constructor(_ref2) {
21527
+ let {
21528
+ onCompactStateChange
21529
+ } = _ref2;
21530
+ _defineProperty(this, "_isCompact", false);
21531
+ _defineProperty(this, "onCompactStateChange", void 0);
21532
+ this.onCompactStateChange = onCompactStateChange;
21533
+ }
21534
+ compact() {
21535
+ this._isCompact = true;
21536
+ this.onCompactStateChange(true);
21537
+ }
21538
+ expand() {
21539
+ this._isCompact = false;
21540
+ this.onCompactStateChange(false);
21541
+ }
21542
+ get isCompact() {
21543
+ return this._isCompact;
21544
+ }
21545
+ }
21546
+ const useRegistry = () => {
21547
+ const parentRegistry = useRegistryContext();
21548
+ const [registry] = (0, _react.useState)(() => new Registry());
21549
+ (0, _react.useLayoutEffect)(() => {
21550
+ if (!parentRegistry) return undefined;
21551
+ parentRegistry.register(registry);
21552
+ return () => {
21553
+ parentRegistry.unregister(registry);
21554
+ };
21555
+ }, [parentRegistry, registry]);
21556
+ return registry;
21557
+ };
21558
+ exports.useRegistry = useRegistry;
21559
+ const useRegistryItem = () => {
21560
+ const registry = useRegistryContext();
21561
+ const [isCompact, setIsCompact] = (0, _react.useState)(false);
21562
+ const [registryItem] = (0, _react.useState)(() => new RegistryItem({
21563
+ onCompactStateChange: setIsCompact
21564
+ }));
21565
+ (0, _react.useLayoutEffect)(() => {
21566
+ if (!registry) return undefined;
21567
+ registry.register(registryItem);
21568
+ return () => {
21569
+ registry.unregister(registryItem);
21570
+ };
21571
+ }, [registry, registryItem]);
21572
+ return [isCompact];
21573
+ };
21574
+ exports.useRegistryItem = useRegistryItem;
21575
+
21576
+ /***/ }),
21577
+
21608
21578
  /***/ "./components/Toolbar/Toolbar.tsx":
21609
21579
  /*!****************************************!*\
21610
21580
  !*** ./components/Toolbar/Toolbar.tsx ***!
@@ -21622,9 +21592,12 @@ var _react = __webpack_require__(/*! react */ "react");
21622
21592
  var _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ "../node_modules/classnames/index.js"));
21623
21593
  var _constants = __webpack_require__(/*! ../../constants */ "./constants.js");
21624
21594
  var _RegistryContext = _interopRequireWildcard(__webpack_require__(/*! ./RegistryContext */ "./components/Toolbar/RegistryContext.tsx"));
21595
+ var _RegistryContextBeta = _interopRequireWildcard(__webpack_require__(/*! ./RegistryContextBeta */ "./components/Toolbar/RegistryContextBeta.tsx"));
21625
21596
  var _DistractionFreeModeContext = _interopRequireDefault(__webpack_require__(/*! ../DistractionFreeModeContext */ "./components/DistractionFreeModeContext/index.tsx"));
21626
21597
  var _ToolbarItem = __webpack_require__(/*! ./ToolbarItem */ "./components/Toolbar/ToolbarItem.tsx");
21627
21598
  var _Squeezer = _interopRequireDefault(__webpack_require__(/*! ../Squeezer */ "./components/Squeezer/index.tsx"));
21599
+ var _hooks = __webpack_require__(/*! ../../hooks */ "./hooks/index.tsx");
21600
+ var _ToolbarBetaProvider = __webpack_require__(/*! ./ToolbarBetaProvider */ "./components/Toolbar/ToolbarBetaProvider.tsx");
21628
21601
  __webpack_require__(/*! ../../helpers/base.less */ "./helpers/base.less");
21629
21602
  __webpack_require__(/*! ./Toolbar.less */ "./components/Toolbar/Toolbar.less");
21630
21603
  var _jsxRuntime = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
@@ -21641,7 +21614,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
21641
21614
  * and controls for changing the way the content block looks.
21642
21615
  * @since 0.0.57
21643
21616
  */
21644
- class Toolbar extends _react.Component {
21617
+ class ToolbarClassComponent extends _react.Component {
21645
21618
  constructor(props) {
21646
21619
  super(props);
21647
21620
  _defineProperty(this, "state", {
@@ -21698,15 +21671,89 @@ class Toolbar extends _react.Component {
21698
21671
  });
21699
21672
  }
21700
21673
  }
21701
- _defineProperty(Toolbar, "defaultProps", {
21674
+ _defineProperty(ToolbarClassComponent, "defaultProps", {
21702
21675
  children: null,
21703
21676
  className: null,
21704
21677
  baseClassName: `${_constants.CLS_PREFIX}toolbar`
21705
21678
  });
21679
+ const ToolbarBeta = _ref2 => {
21680
+ let {
21681
+ children,
21682
+ className,
21683
+ baseClassName = `${_constants.CLS_PREFIX}toolbar`,
21684
+ ...props
21685
+ } = _ref2;
21686
+ const containerRef = (0, _react.useRef)(null);
21687
+ const [isDistractionFreeModeEnabled, setIsDistractionFreeModeEnabled] = (0, _react.useState)(false);
21688
+ const distractionFreeModeContextValue = (0, _react.useMemo)(() => ({
21689
+ enabled: isDistractionFreeModeEnabled,
21690
+ toggle: () => setIsDistractionFreeModeEnabled(current => !current)
21691
+ }), [isDistractionFreeModeEnabled]);
21692
+ const registry = (0, _RegistryContextBeta.useRegistry)();
21693
+ (0, _hooks.useSqueeze)({
21694
+ ref: containerRef,
21695
+ compact: () => registry.compact(),
21696
+ expand: () => registry.expand()
21697
+ });
21698
+ const toolbarItems = (0, _ToolbarItem.toToolbarItems)(children, true);
21699
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
21700
+ ref: containerRef,
21701
+ className: (0, _classnames.default)(baseClassName, className),
21702
+ ...props,
21703
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_RegistryContextBeta.default.Provider, {
21704
+ value: registry,
21705
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DistractionFreeModeContext.default.Provider, {
21706
+ value: distractionFreeModeContextValue,
21707
+ children: toolbarItems
21708
+ })
21709
+ })
21710
+ });
21711
+ };
21712
+ const Toolbar = props => {
21713
+ const isToolbarBeta = (0, _ToolbarBetaProvider.useToolbarBetaContext)();
21714
+ return isToolbarBeta ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarBeta, {
21715
+ ...props
21716
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarClassComponent, {
21717
+ ...props
21718
+ });
21719
+ };
21706
21720
  var _default = exports["default"] = Toolbar;
21707
21721
 
21708
21722
  /***/ }),
21709
21723
 
21724
+ /***/ "./components/Toolbar/ToolbarBetaProvider.tsx":
21725
+ /*!****************************************************!*\
21726
+ !*** ./components/Toolbar/ToolbarBetaProvider.tsx ***!
21727
+ \****************************************************/
21728
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
21729
+
21730
+ "use strict";
21731
+
21732
+
21733
+ Object.defineProperty(exports, "__esModule", ({
21734
+ value: true
21735
+ }));
21736
+ exports.useToolbarBetaContext = exports["default"] = void 0;
21737
+ var _react = __webpack_require__(/*! react */ "react");
21738
+ var _jsxRuntime = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
21739
+ // Copyright 1999-2024. Plesk International GmbH. All rights reserved.
21740
+
21741
+ const ToolbarBetaContext = /*#__PURE__*/(0, _react.createContext)(false);
21742
+ const useToolbarBetaContext = () => (0, _react.useContext)(ToolbarBetaContext);
21743
+ exports.useToolbarBetaContext = useToolbarBetaContext;
21744
+ const ToolbarBetaProvider = _ref => {
21745
+ let {
21746
+ children
21747
+ } = _ref;
21748
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarBetaContext.Provider, {
21749
+ value: true,
21750
+ children: children
21751
+ });
21752
+ };
21753
+ var _default = exports["default"] = ToolbarBetaProvider;
21754
+
21755
+ /***/ }),
21756
+
21710
21757
  /***/ "./components/Toolbar/ToolbarExpander.tsx":
21711
21758
  /*!************************************************!*\
21712
21759
  !*** ./components/Toolbar/ToolbarExpander.tsx ***!
@@ -21774,9 +21821,11 @@ var _constants = __webpack_require__(/*! ../../constants */ "./constants.js");
21774
21821
  var _Dropdown = _interopRequireDefault(__webpack_require__(/*! ../Dropdown */ "./components/Dropdown/index.tsx"));
21775
21822
  var _ToolbarMenu = _interopRequireDefault(__webpack_require__(/*! ./ToolbarMenu */ "./components/Toolbar/ToolbarMenu.tsx"));
21776
21823
  var _RegistryContext = _interopRequireWildcard(__webpack_require__(/*! ./RegistryContext */ "./components/Toolbar/RegistryContext.tsx"));
21824
+ var _RegistryContextBeta = _interopRequireWildcard(__webpack_require__(/*! ./RegistryContextBeta */ "./components/Toolbar/RegistryContextBeta.tsx"));
21777
21825
  var _DistractionFreeModeContext = _interopRequireDefault(__webpack_require__(/*! ../DistractionFreeModeContext */ "./components/DistractionFreeModeContext/index.tsx"));
21778
21826
  var _ToolbarItem = __webpack_require__(/*! ./ToolbarItem */ "./components/Toolbar/ToolbarItem.tsx");
21779
21827
  var _ToolbarExpander = _interopRequireDefault(__webpack_require__(/*! ./ToolbarExpander */ "./components/Toolbar/ToolbarExpander.tsx"));
21828
+ var _ToolbarBetaProvider = __webpack_require__(/*! ./ToolbarBetaProvider */ "./components/Toolbar/ToolbarBetaProvider.tsx");
21780
21829
  var _jsxRuntime = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
21781
21830
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
21782
21831
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -21789,7 +21838,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
21789
21838
  * It is used for grouping several toolbar controls together.
21790
21839
  * @since 0.0.57
21791
21840
  */
21792
- class ToolbarGroup extends _react.Component {
21841
+ class ToolbarGroupClassComponent extends _react.Component {
21793
21842
  constructor(props) {
21794
21843
  super(props);
21795
21844
  _defineProperty(this, "state", {
@@ -21909,7 +21958,7 @@ class ToolbarGroup extends _react.Component {
21909
21958
  });
21910
21959
  }
21911
21960
  }
21912
- _defineProperty(ToolbarGroup, "defaultProps", {
21961
+ _defineProperty(ToolbarGroupClassComponent, "defaultProps", {
21913
21962
  registry: undefined,
21914
21963
  distractionFreeMode: undefined
21915
21964
  });
@@ -21921,7 +21970,7 @@ const ToolbarGroupWrapper = _ref => {
21921
21970
  } = _ref;
21922
21971
  const registry = (0, _react.useContext)(_RegistryContext.default);
21923
21972
  const distractionFreeMode = (0, _react.useContext)(_DistractionFreeModeContext.default);
21924
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarGroup, {
21973
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarGroupClassComponent, {
21925
21974
  groupable: groupable,
21926
21975
  baseClassName: baseClassName,
21927
21976
  ...props,
@@ -21930,7 +21979,67 @@ const ToolbarGroupWrapper = _ref => {
21930
21979
  });
21931
21980
  };
21932
21981
  ToolbarGroupWrapper.displayName = 'ToolbarGroup';
21933
- var _default = exports["default"] = ToolbarGroupWrapper;
21982
+ const ToolbarGroupBeta = _ref2 => {
21983
+ let {
21984
+ baseClassName = `${_constants.CLS_PREFIX}toolbar__group`,
21985
+ className,
21986
+ title,
21987
+ children,
21988
+ groupable = true,
21989
+ ...props
21990
+ } = _ref2;
21991
+ const [compact] = (0, _RegistryContextBeta.useRegistryItem)();
21992
+ const registry = (0, _RegistryContextBeta.useRegistry)();
21993
+ const [availableInDistractionFreeMode, setAvailableInDistractionFreeMode] = (0, _react.useState)(false);
21994
+ const distractionFreeMode = (0, _react.useContext)(_DistractionFreeModeContext.default);
21995
+ const distractionFreeModeContextValue = {
21996
+ enabled: distractionFreeMode?.enabled ?? false,
21997
+ toggle: () => {
21998
+ if (distractionFreeMode) {
21999
+ distractionFreeMode.toggle();
22000
+ setAvailableInDistractionFreeMode(current => !current);
22001
+ }
22002
+ }
22003
+ };
22004
+ let hasExpander = _react.Children.toArray(children).some(child => /*#__PURE__*/(0, _react.isValidElement)(child) && child.type === _ToolbarExpander.default);
22005
+ if (groupable && compact && _react.Children.count(children) > 1) {
22006
+ hasExpander = false;
22007
+ children = /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dropdown.default, {
22008
+ menu: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ToolbarMenu.default, {
22009
+ onItemClick: () => {},
22010
+ children: children
22011
+ }),
22012
+ children: title
22013
+ });
22014
+ } else {
22015
+ children = /*#__PURE__*/(0, _jsxRuntime.jsx)(_RegistryContextBeta.default.Provider, {
22016
+ value: registry,
22017
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DistractionFreeModeContext.default.Provider, {
22018
+ value: distractionFreeModeContextValue,
22019
+ children: (0, _ToolbarItem.toToolbarItems)(children, true)
22020
+ })
22021
+ });
22022
+ }
22023
+ if (distractionFreeModeContextValue.enabled && !availableInDistractionFreeMode) {
22024
+ return null;
22025
+ }
22026
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
22027
+ className: (0, _classnames.default)(baseClassName, className, {
22028
+ [`${baseClassName}--grow`]: hasExpander || distractionFreeModeContextValue.enabled && availableInDistractionFreeMode
22029
+ }),
22030
+ ...props,
22031
+ children: children
22032
+ });
22033
+ };
22034
+ const ToolbarGroup = props => {
22035
+ const isToolbarBeta = (0, _ToolbarBetaProvider.useToolbarBetaContext)();
22036
+ return isToolbarBeta ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarGroupBeta, {
22037
+ ...props
22038
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarGroupWrapper, {
22039
+ ...props
22040
+ });
22041
+ };
22042
+ var _default = exports["default"] = ToolbarGroup;
21934
22043
 
21935
22044
  /***/ }),
21936
22045
 
@@ -21954,6 +22063,7 @@ var _ResponsiveContext = _interopRequireDefault(__webpack_require__(/*! ../Respo
21954
22063
  var _RegistryContext = _interopRequireDefault(__webpack_require__(/*! ./RegistryContext */ "./components/Toolbar/RegistryContext.tsx"));
21955
22064
  var _ToolbarGroup = _interopRequireDefault(__webpack_require__(/*! ./ToolbarGroup */ "./components/Toolbar/ToolbarGroup.tsx"));
21956
22065
  var _ToolbarExpander = _interopRequireDefault(__webpack_require__(/*! ./ToolbarExpander */ "./components/Toolbar/ToolbarExpander.tsx"));
22066
+ var _RegistryContextBeta = __webpack_require__(/*! ./RegistryContextBeta */ "./components/Toolbar/RegistryContextBeta.tsx");
21957
22067
  var _jsxRuntime = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
21958
22068
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21959
22069
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -21997,19 +22107,33 @@ class ToolbarItem extends _react.Component {
21997
22107
  }
21998
22108
  }
21999
22109
  ToolbarItem.contextType = _RegistryContext.default;
22000
- const toToolbarItems = children => _react.Children.map(children, child => {
22001
- if (! /*#__PURE__*/(0, _react.isValidElement)(child)) {
22002
- return child;
22003
- }
22004
- if (child.type === _ToolbarGroup.default || child.type === _ToolbarExpander.default) {
22005
- return child;
22006
- }
22007
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(ToolbarItem, {
22008
- children: /*#__PURE__*/(0, _react.cloneElement)(child, {
22009
- className: (0, _classnames.default)(child.props.className, `${_constants.CLS_PREFIX}toolbar__group-item`)
22010
- })
22110
+ const ToolbarItemBeta = _ref => {
22111
+ let {
22112
+ children
22113
+ } = _ref;
22114
+ const [isCompact] = (0, _RegistryContextBeta.useRegistryItem)();
22115
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ResponsiveContext.default.Provider, {
22116
+ value: isCompact,
22117
+ children: children
22011
22118
  });
22012
- });
22119
+ };
22120
+ const toToolbarItems = function (children) {
22121
+ let isBeta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
22122
+ return _react.Children.map(children, child => {
22123
+ if (! /*#__PURE__*/(0, _react.isValidElement)(child)) {
22124
+ return child;
22125
+ }
22126
+ if (child.type === _ToolbarGroup.default || child.type === _ToolbarExpander.default) {
22127
+ return child;
22128
+ }
22129
+ const Component = isBeta ? ToolbarItemBeta : ToolbarItem;
22130
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
22131
+ children: /*#__PURE__*/(0, _react.cloneElement)(child, {
22132
+ className: (0, _classnames.default)(child.props.className, `${_constants.CLS_PREFIX}toolbar__group-item`)
22133
+ })
22134
+ });
22135
+ });
22136
+ };
22013
22137
  exports.toToolbarItems = toToolbarItems;
22014
22138
 
22015
22139
  /***/ }),
@@ -22035,6 +22159,7 @@ var _Button = _interopRequireDefault(__webpack_require__(/*! ../Button */ "./com
22035
22159
  var _Dropdown = _interopRequireDefault(__webpack_require__(/*! ../Dropdown */ "./components/Dropdown/index.tsx"));
22036
22160
  var _List = __webpack_require__(/*! ../List */ "./components/List/index.tsx");
22037
22161
  var _utils = __webpack_require__(/*! ../utils */ "./components/utils.tsx");
22162
+ var _Button2 = __webpack_require__(/*! ../Button/Button */ "./components/Button/Button.tsx");
22038
22163
  var _jsxRuntime = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
22039
22164
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22040
22165
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
@@ -22056,7 +22181,7 @@ const toMenuItem = (child, isLast, onItemClick) => {
22056
22181
  } = child.props);
22057
22182
  props.onClick = (0, _utils.wrapFunction)(props.onClick, onItemClick);
22058
22183
  Object.keys(other).forEach(k => {
22059
- if (!(_Button.default.defaultProps && k in _Button.default.defaultProps)) {
22184
+ if (!_Button2.BUTTON_PROP_NAMES.includes(k)) {
22060
22185
  props[k] = other[k];
22061
22186
  }
22062
22187
  });
@@ -22159,6 +22284,12 @@ var _default = exports["default"] = ToolbarMenu;
22159
22284
  Object.defineProperty(exports, "__esModule", ({
22160
22285
  value: true
22161
22286
  }));
22287
+ Object.defineProperty(exports, "ToolbarBetaProvider", ({
22288
+ enumerable: true,
22289
+ get: function () {
22290
+ return _ToolbarBetaProvider.default;
22291
+ }
22292
+ }));
22162
22293
  Object.defineProperty(exports, "ToolbarExpander", ({
22163
22294
  enumerable: true,
22164
22295
  get: function () {
@@ -22180,6 +22311,7 @@ Object.defineProperty(exports, "default", ({
22180
22311
  var _Toolbar = _interopRequireDefault(__webpack_require__(/*! ./Toolbar */ "./components/Toolbar/Toolbar.tsx"));
22181
22312
  var _ToolbarGroup = _interopRequireDefault(__webpack_require__(/*! ./ToolbarGroup */ "./components/Toolbar/ToolbarGroup.tsx"));
22182
22313
  var _ToolbarExpander = _interopRequireDefault(__webpack_require__(/*! ./ToolbarExpander */ "./components/Toolbar/ToolbarExpander.tsx"));
22314
+ var _ToolbarBetaProvider = _interopRequireDefault(__webpack_require__(/*! ./ToolbarBetaProvider */ "./components/Toolbar/ToolbarBetaProvider.tsx"));
22183
22315
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22184
22316
 
22185
22317
  /***/ }),
@@ -22789,6 +22921,7 @@ var _exportNames = {
22789
22921
  ProgressDialog: true,
22790
22922
  ProgressDialogStep: true,
22791
22923
  ProgressStep: true,
22924
+ PROGRESS_STEP_DEFAULT_STATUS: true,
22792
22925
  Rating: true,
22793
22926
  Section: true,
22794
22927
  SegmentedControl: true,
@@ -22810,6 +22943,7 @@ var _exportNames = {
22810
22943
  Toolbar: true,
22811
22944
  ToolbarGroup: true,
22812
22945
  ToolbarExpander: true,
22946
+ ToolbarBetaProvider: true,
22813
22947
  Tooltip: true,
22814
22948
  Tour: true,
22815
22949
  Translate: true,
@@ -23203,6 +23337,12 @@ Object.defineProperty(exports, "Overlay", ({
23203
23337
  return _Overlay.default;
23204
23338
  }
23205
23339
  }));
23340
+ Object.defineProperty(exports, "PROGRESS_STEP_DEFAULT_STATUS", ({
23341
+ enumerable: true,
23342
+ get: function () {
23343
+ return _ProgressStep.PROGRESS_STEP_DEFAULT_STATUS;
23344
+ }
23345
+ }));
23206
23346
  Object.defineProperty(exports, "PageHeader", ({
23207
23347
  enumerable: true,
23208
23348
  get: function () {
@@ -23425,6 +23565,12 @@ Object.defineProperty(exports, "Toolbar", ({
23425
23565
  return _Toolbar.default;
23426
23566
  }
23427
23567
  }));
23568
+ Object.defineProperty(exports, "ToolbarBetaProvider", ({
23569
+ enumerable: true,
23570
+ get: function () {
23571
+ return _Toolbar.ToolbarBetaProvider;
23572
+ }
23573
+ }));
23428
23574
  Object.defineProperty(exports, "ToolbarExpander", ({
23429
23575
  enumerable: true,
23430
23576
  get: function () {
@@ -23584,7 +23730,7 @@ var _Progress = _interopRequireDefault(__webpack_require__(/*! ./Progress */ "./
23584
23730
  var _ProgressBar = _interopRequireDefault(__webpack_require__(/*! ./ProgressBar */ "./components/ProgressBar/index.tsx"));
23585
23731
  var _ProgressDialog = _interopRequireDefault(__webpack_require__(/*! ./ProgressDialog */ "./components/ProgressDialog/index.tsx"));
23586
23732
  var _ProgressDialogStep = _interopRequireDefault(__webpack_require__(/*! ./ProgressDialogStep */ "./components/ProgressDialogStep/index.js"));
23587
- var _ProgressStep = _interopRequireDefault(__webpack_require__(/*! ./ProgressStep */ "./components/ProgressStep/index.tsx"));
23733
+ var _ProgressStep = _interopRequireWildcard(__webpack_require__(/*! ./ProgressStep */ "./components/ProgressStep/index.tsx"));
23588
23734
  var _Rating = _interopRequireDefault(__webpack_require__(/*! ./Rating */ "./components/Rating/index.tsx"));
23589
23735
  var _Section = _interopRequireWildcard(__webpack_require__(/*! ./Section */ "./components/Section/index.tsx"));
23590
23736
  Object.keys(_Section).forEach(function (key) {
@@ -23898,6 +24044,125 @@ module.exports = {
23898
24044
 
23899
24045
  /***/ }),
23900
24046
 
24047
+ /***/ "./hooks/index.tsx":
24048
+ /*!*************************!*\
24049
+ !*** ./hooks/index.tsx ***!
24050
+ \*************************/
24051
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
24052
+
24053
+ "use strict";
24054
+
24055
+
24056
+ Object.defineProperty(exports, "__esModule", ({
24057
+ value: true
24058
+ }));
24059
+ Object.defineProperty(exports, "useSqueeze", ({
24060
+ enumerable: true,
24061
+ get: function () {
24062
+ return _useSqueeze.useSqueeze;
24063
+ }
24064
+ }));
24065
+ var _useSqueeze = __webpack_require__(/*! ./useSqueeze */ "./hooks/useSqueeze.tsx");
24066
+
24067
+ /***/ }),
24068
+
24069
+ /***/ "./hooks/useResizeObserver.tsx":
24070
+ /*!*************************************!*\
24071
+ !*** ./hooks/useResizeObserver.tsx ***!
24072
+ \*************************************/
24073
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
24074
+
24075
+ "use strict";
24076
+
24077
+
24078
+ Object.defineProperty(exports, "__esModule", ({
24079
+ value: true
24080
+ }));
24081
+ exports.useResizeObserver = void 0;
24082
+ var _react = __webpack_require__(/*! react */ "react");
24083
+ // Copyright 1999-2024. Plesk International GmbH. All rights reserved.
24084
+
24085
+ const useResizeObserver = _ref => {
24086
+ let {
24087
+ ref,
24088
+ onResize
24089
+ } = _ref;
24090
+ const onResizeRef = (0, _react.useRef)(undefined);
24091
+ onResizeRef.current = onResize;
24092
+ (0, _react.useEffect)(() => {
24093
+ if (!ref.current) return undefined;
24094
+ if (typeof window === 'undefined' || !('ResizeObserver' in window)) return undefined;
24095
+ const observer = new ResizeObserver(() => {
24096
+ onResizeRef.current?.();
24097
+ });
24098
+ observer.observe(ref.current);
24099
+ return () => {
24100
+ observer.disconnect();
24101
+ };
24102
+ }, [ref]);
24103
+ };
24104
+ exports.useResizeObserver = useResizeObserver;
24105
+
24106
+ /***/ }),
24107
+
24108
+ /***/ "./hooks/useSqueeze.tsx":
24109
+ /*!******************************!*\
24110
+ !*** ./hooks/useSqueeze.tsx ***!
24111
+ \******************************/
24112
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
24113
+
24114
+ "use strict";
24115
+
24116
+
24117
+ Object.defineProperty(exports, "__esModule", ({
24118
+ value: true
24119
+ }));
24120
+ exports.useSqueeze = void 0;
24121
+ var _react = __webpack_require__(/*! react */ "react");
24122
+ var _useResizeObserver = __webpack_require__(/*! ./useResizeObserver */ "./hooks/useResizeObserver.tsx");
24123
+ // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
24124
+
24125
+ const useSqueeze = _ref => {
24126
+ let {
24127
+ ref,
24128
+ compact,
24129
+ expand
24130
+ } = _ref;
24131
+ const minWidth = (0, _react.useRef)(0);
24132
+ const lastAction = (0, _react.useRef)(null);
24133
+ const [recheck, setRecheck] = (0, _react.useState)(false);
24134
+ const checkRef = (0, _react.useRef)();
24135
+ const check = () => {
24136
+ if (!ref.current) return;
24137
+ const root = ref.current;
24138
+ const width = Math.ceil(root.getBoundingClientRect().width);
24139
+ const scrollWidth = Math.floor(root.scrollWidth);
24140
+ let isCompactChanged = false;
24141
+ if (scrollWidth > width) {
24142
+ isCompactChanged = compact();
24143
+ minWidth.current = scrollWidth;
24144
+ lastAction.current = 'compact';
24145
+ } else if (minWidth.current && width > minWidth.current || lastAction.current === 'expand') {
24146
+ isCompactChanged = expand();
24147
+ lastAction.current = 'expand';
24148
+ }
24149
+ if (isCompactChanged) {
24150
+ setRecheck(c => !c);
24151
+ }
24152
+ };
24153
+ checkRef.current = check;
24154
+ (0, _react.useLayoutEffect)(() => {
24155
+ checkRef.current?.();
24156
+ }, [recheck]);
24157
+ (0, _useResizeObserver.useResizeObserver)({
24158
+ ref,
24159
+ onResize: check
24160
+ });
24161
+ };
24162
+ exports.useSqueeze = useSqueeze;
24163
+
24164
+ /***/ }),
24165
+
23901
24166
  /***/ "./index.tsx":
23902
24167
  /*!*******************!*\
23903
24168
  !*** ./index.tsx ***!
@@ -83256,6 +83521,7 @@ function validateFragmentProps(fragment) {
83256
83521
  }
83257
83522
  }
83258
83523
 
83524
+ var didWarnAboutKeySpread = {};
83259
83525
  function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
83260
83526
  {
83261
83527
  var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
@@ -83326,6 +83592,24 @@ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
83326
83592
  }
83327
83593
  }
83328
83594
 
83595
+ {
83596
+ if (hasOwnProperty.call(props, 'key')) {
83597
+ var componentName = getComponentNameFromType(type);
83598
+ var keys = Object.keys(props).filter(function (k) {
83599
+ return k !== 'key';
83600
+ });
83601
+ var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
83602
+
83603
+ if (!didWarnAboutKeySpread[componentName + beforeExample]) {
83604
+ var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
83605
+
83606
+ error('A props object containing a "key" prop is being spread into JSX:\n' + ' let props = %s;\n' + ' <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + ' let props = %s;\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
83607
+
83608
+ didWarnAboutKeySpread[componentName + beforeExample] = true;
83609
+ }
83610
+ }
83611
+ }
83612
+
83329
83613
  if (type === REACT_FRAGMENT_TYPE) {
83330
83614
  validateFragmentProps(element);
83331
83615
  } else {
@@ -87617,12 +87901,11 @@ __webpack_require__.r(__webpack_exports__);
87617
87901
  function _objectWithoutPropertiesLoose(source, excluded) {
87618
87902
  if (source == null) return {};
87619
87903
  var target = {};
87620
- var sourceKeys = Object.keys(source);
87621
- var key, i;
87622
- for (i = 0; i < sourceKeys.length; i++) {
87623
- key = sourceKeys[i];
87624
- if (excluded.indexOf(key) >= 0) continue;
87625
- target[key] = source[key];
87904
+ for (var key in source) {
87905
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
87906
+ if (excluded.indexOf(key) >= 0) continue;
87907
+ target[key] = source[key];
87908
+ }
87626
87909
  }
87627
87910
  return target;
87628
87911
  }
@@ -87657,7 +87940,7 @@ function _setPrototypeOf(o, p) {
87657
87940
  /***/ ((module) => {
87658
87941
 
87659
87942
  "use strict";
87660
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@plesk/ui-library","version":"3.39.0","description":"Plesk UI Library","main":"index.js","module":"esm/index.js","types":"./types/src","sideEffects":["cjs/index.js","esm/index.js","dist/*.js","dist/*.css"],"scripts":{"pretest":"yarn lint","test":"jest --ci --coverage --coverageReporters text-summary","test:vr":"cross-env VISUAL_REGRESSION=true jest","build":"yarn build:types && yarn build:umd && yarn build:esm && yarn build:cjs","build:umd":"webpack --config ./configs/build.config.js","build:esm":"cross-env NODE_ENV=esm node ./scripts/build.js","build:cjs":"cross-env NODE_ENV=cjs node ./scripts/build.js","build:types":"rimraf ./types && tsc --project ./configs/types-generator.config.json","create-svg-sprite":"node ./scripts/create-svg-sprite.js","lint":"yarn lint:es && yarn lint:types && yarn lint:style && yarn format:check","lint:es":"eslint --ext js,md,tsx src configs scripts styleguidist","lint:types":"tsc","lint:style":"stylelint \\"{src,styleguidist}/**/*.less\\"","format:check":"prettier --check src","format":"prettier --write src","styleguide":"styleguidist server --config ./configs/styleguide.config.js","styleguide:build":"styleguidist build --config ./configs/styleguide.config.js","prepublishOnly":"yarn install && yarn test && yarn build && yarn styleguide:build","storybook":"webpack serve --config ./configs/storybook.config.js --allowed-hosts all","postinstall":"node ./scripts/postinstall.js"},"files":["esm","cjs","dist","styleguide","types","/scripts/postinstall.js","/index.js"],"dependencies":{"@babel/runtime":"^7.24.4","@plesk/react-movable":"^2.7.1","classnames":"^2.5.1","codemirror":"5.58.2","marked":"4.2.12","memoize-one":"^5.2.1","popper.js":"1.16.1","prop-types":"^15.8.1","react-measure":"2.5.2","react-sortable-hoc":"0.6.8","react-transition-group":"^4.4.5","scroll-into-view-if-needed":"^2.2.31","svg4everybody":"2.1.9","use-focus-visible":"^1.0.2"},"devDependencies":{"@babel/core":"^7.24.4","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-transform-runtime":"^7.24.3","@babel/preset-env":"^7.24.4","@babel/preset-react":"^7.24.1","@babel/preset-typescript":"^7.24.1","@babel/types":"^7.24.0","@csstools/postcss-logical-float-and-clear":"^1.0.1","@plesk/eslint-config":"^3.0.0","@plesk/stylelint-config":"^2.0.0","@testing-library/dom":"^9.3.4","@testing-library/jest-dom":"^6.4.2","@testing-library/react":"^14.3.1","@testing-library/user-event":"^14.5.2","@types/buble":"^0.20.5","@types/classnames":"2.3.1","@types/codemirror":"^5.60.15","@types/doctrine":"^0.0.5","@types/jest":"^29.5.12","@types/jest-image-snapshot":"^6.4.0","@types/marked":"^4.3.2","@types/node":"^16.18.96","@types/react":"^18.2.79","@types/react-dom":"^18.2.25","@types/react-measure":"2.0.9","@types/react-transition-group":"^4.4.10","@types/svg4everybody":"2.1.2","@types/webpack-env":"^1.18.4","@typescript-eslint/eslint-plugin":"^6.21.0","@typescript-eslint/parser":"^6.21.0","autoprefixer":"^10.4.19","babel-loader":"^8.3.0","babel-plugin-transform-require-ignore":"^0.1.1","clean-webpack-plugin":"^4.0.0","cross-env":"^7.0.3","css-loader":"^6.11.0","css-minimizer-webpack-plugin":"^5.0.1","eslint":"^8.57.0","eslint-config-prettier":"^8.10.0","eslint-plugin-markdown":"^3.0.1","html-webpack-plugin":"^5.6.0","jest":"^29.7.0","jest-dev-server":"^9.0.2","jest-environment-jsdom":"^29.7.0","jest-image-snapshot":"^6.4.0","less":"^4.2.0","less-loader":"^11.1.4","mini-css-extract-plugin":"^2.9.0","postcss":"^8.4.38","postcss-less":"^6.0.0","postcss-loader":"^7.3.4","postcss-logical":"^6.2.0","prettier":"^2.8.8","puppeteer-core":"21.7.0","react":"^18.2.0","react-docgen-typescript":"^2.2.2","react-dom":"^18.2.0","react-styleguidist":"^13.1.2","rimraf":"^5.0.5","rtlcss":"^4.1.1","style-loader":"^3.3.4","stylelint":"^15.11.0","stylelint-declaration-block-no-ignored-properties":"^2.8.0","stylelint-no-unsupported-browser-features":"^6.1.0","stylelint-prettier":"^3.0.0","stylelint-use-logical-spec":"^5.0.1","svg-mixer":"^2.3.14","terser-webpack-plugin":"^5.3.10","typescript":"5.2.2","webpack":"^5.91.0","webpack-cli":"^5.1.4"},"peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"resolutions":{"trim":">=0.0.3","postcss":"^8.4.23"},"browserslist":["defaults","not op_mini all","not kaios > 0"],"author":"Plesk Developers <plesk-dev-leads@plesk.com> (https://www.plesk.com/)","license":"Apache-2.0"}');
87943
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@plesk/ui-library","version":"3.40.1","description":"Plesk UI Library","main":"index.js","module":"esm/index.js","types":"./types/src","sideEffects":["cjs/index.js","esm/index.js","dist/*.js","dist/*.css"],"scripts":{"pretest":"yarn lint","test":"jest --ci --coverage --coverageReporters text-summary","test:vr":"cross-env VISUAL_REGRESSION=true jest","build":"yarn build:types && yarn build:umd && yarn build:esm && yarn build:cjs","build:umd":"webpack --config ./configs/build.config.js","build:esm":"cross-env NODE_ENV=esm node ./scripts/build.js","build:cjs":"cross-env NODE_ENV=cjs node ./scripts/build.js","build:types":"rimraf ./types && tsc --project ./configs/types-generator.config.json","create-svg-sprite":"node ./scripts/create-svg-sprite.js","lint":"yarn lint:es && yarn lint:types && yarn lint:style && yarn format:check","lint:es":"eslint --ext js,md,tsx src configs scripts styleguidist","lint:types":"tsc","lint:style":"stylelint \\"{src,styleguidist}/**/*.less\\"","format:check":"prettier --check src","format":"prettier --write src","styleguide":"styleguidist server --config ./configs/styleguide.config.js","styleguide:build":"styleguidist build --config ./configs/styleguide.config.js","prepublishOnly":"yarn install && yarn test && yarn build && yarn styleguide:build","storybook":"webpack serve --config ./configs/storybook.config.js --allowed-hosts all","postinstall":"node ./scripts/postinstall.js"},"files":["esm","cjs","dist","styleguide","types","/scripts/postinstall.js","/index.js"],"dependencies":{"@babel/runtime":"^7.24.5","@plesk/react-movable":"^2.7.1","classnames":"^2.5.1","codemirror":"5.58.2","marked":"4.2.12","memoize-one":"^5.2.1","popper.js":"1.16.1","prop-types":"^15.8.1","react-measure":"2.5.2","react-sortable-hoc":"0.6.8","react-transition-group":"^4.4.5","scroll-into-view-if-needed":"^2.2.31","svg4everybody":"2.1.9","use-focus-visible":"^1.0.2"},"devDependencies":{"@babel/core":"^7.24.5","@babel/plugin-proposal-class-properties":"^7.18.6","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-transform-runtime":"^7.24.3","@babel/preset-env":"^7.24.5","@babel/preset-react":"^7.24.1","@babel/preset-typescript":"^7.24.1","@babel/types":"^7.24.5","@csstools/postcss-logical-float-and-clear":"^1.0.1","@plesk/eslint-config":"^3.0.0","@plesk/stylelint-config":"^2.0.0","@testing-library/dom":"^9.3.4","@testing-library/jest-dom":"^6.4.5","@testing-library/react":"^14.3.1","@testing-library/user-event":"^14.5.2","@types/buble":"^0.20.5","@types/classnames":"2.3.1","@types/codemirror":"^5.60.15","@types/doctrine":"^0.0.5","@types/jest":"^29.5.12","@types/jest-image-snapshot":"^6.4.0","@types/marked":"^4.3.2","@types/node":"^16.18.96","@types/react":"^18.3.1","@types/react-dom":"^18.3.0","@types/react-measure":"2.0.9","@types/react-transition-group":"^4.4.10","@types/svg4everybody":"2.1.2","@types/webpack-env":"^1.18.4","@typescript-eslint/eslint-plugin":"^6.21.0","@typescript-eslint/parser":"^6.21.0","autoprefixer":"^10.4.19","babel-loader":"^8.3.0","babel-plugin-transform-require-ignore":"^0.1.1","clean-webpack-plugin":"^4.0.0","cross-env":"^7.0.3","css-loader":"^6.11.0","css-minimizer-webpack-plugin":"^5.0.1","eslint":"^8.57.0","eslint-config-prettier":"^8.10.0","eslint-plugin-markdown":"^3.0.1","html-webpack-plugin":"^5.6.0","jest":"^29.7.0","jest-dev-server":"^9.0.2","jest-environment-jsdom":"^29.7.0","jest-image-snapshot":"^6.4.0","less":"^4.2.0","less-loader":"^11.1.4","mini-css-extract-plugin":"^2.9.0","postcss":"^8.4.38","postcss-less":"^6.0.0","postcss-loader":"^7.3.4","postcss-logical":"^6.2.0","prettier":"^2.8.8","puppeteer-core":"21.7.0","react":"^18.3.1","react-docgen-typescript":"^2.2.2","react-dom":"^18.3.1","react-styleguidist":"^13.1.2","rimraf":"^5.0.5","rtlcss":"^4.1.1","style-loader":"^3.3.4","stylelint":"^15.11.0","stylelint-declaration-block-no-ignored-properties":"^2.8.0","stylelint-no-unsupported-browser-features":"^6.1.0","stylelint-prettier":"^3.0.0","stylelint-use-logical-spec":"^5.0.1","svg-mixer":"^2.3.14","terser-webpack-plugin":"^5.3.10","typescript":"5.2.2","webpack":"^5.91.0","webpack-cli":"^5.1.4"},"peerDependencies":{"react":"^18.2.0","react-dom":"^18.2.0"},"resolutions":{"trim":">=0.0.3","postcss":"^8.4.23"},"browserslist":["defaults","not op_mini all","not kaios > 0"],"author":"Plesk Developers <plesk-dev-leads@plesk.com> (https://www.plesk.com/)","license":"Apache-2.0"}');
87661
87944
 
87662
87945
  /***/ }),
87663
87946