@plesk/ui-library 3.34.1 → 3.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/cjs/components/ContentLoader/IconsLoader.js +1 -2
  2. package/cjs/components/Drawer/Drawer.js +10 -143
  3. package/cjs/components/Drawer/Header.js +5 -12
  4. package/cjs/components/Dropdown/Dropdown.js +0 -2
  5. package/cjs/components/Dropdown/index.js +15 -2
  6. package/cjs/components/Figure/Figure.js +1 -33
  7. package/cjs/components/Figure/index.js +15 -2
  8. package/cjs/components/Form/Form.js +3 -3
  9. package/cjs/components/Form/ScrollableElementFormContext.js +1 -1
  10. package/cjs/components/Form/index.js +19 -3
  11. package/cjs/components/FormFieldPassword/PasswordMeter.js +4 -4
  12. package/cjs/components/Icon/constants.js +2 -2
  13. package/cjs/components/Icon/images/symbols.svg +9 -1
  14. package/cjs/components/Link/Link.js +11 -18
  15. package/cjs/components/Overlay/Overlay.js +3 -4
  16. package/cjs/components/Popper/Popper.js +14 -79
  17. package/cjs/components/Popper/index.js +15 -2
  18. package/cjs/components/Section/Section.js +1 -2
  19. package/cjs/components/Skeleton/SkeletonText.js +1 -1
  20. package/cjs/components/SplitButton/SplitButton.js +10 -49
  21. package/cjs/components/SplitButton/index.js +15 -2
  22. package/cjs/components/index.js +2 -30
  23. package/cjs/components/utils.js +1 -1
  24. package/cjs/index.js +1 -1
  25. package/dist/images/symbols.svg +9 -1
  26. package/dist/plesk-ui-library-rtl.css.map +1 -1
  27. package/dist/plesk-ui-library.css.map +1 -1
  28. package/dist/plesk-ui-library.js +213 -461
  29. package/dist/plesk-ui-library.js.map +1 -1
  30. package/dist/plesk-ui-library.min.js +2 -2
  31. package/dist/plesk-ui-library.min.js.map +1 -1
  32. package/esm/components/ContentLoader/IconsLoader.js +1 -2
  33. package/esm/components/Drawer/Drawer.js +10 -141
  34. package/esm/components/Drawer/Header.js +5 -10
  35. package/esm/components/Dropdown/Dropdown.js +0 -2
  36. package/esm/components/Dropdown/index.js +2 -1
  37. package/esm/components/Figure/Figure.js +1 -33
  38. package/esm/components/Figure/index.js +2 -1
  39. package/esm/components/Form/Form.js +3 -3
  40. package/esm/components/Form/ScrollableElementFormContext.js +1 -1
  41. package/esm/components/Form/index.js +1 -0
  42. package/esm/components/FormFieldPassword/PasswordMeter.js +4 -4
  43. package/esm/components/Icon/constants.js +2 -2
  44. package/esm/components/Icon/images/symbols.svg +9 -1
  45. package/esm/components/Link/Link.js +11 -18
  46. package/esm/components/Overlay/Overlay.js +3 -4
  47. package/esm/components/Popper/Popper.js +14 -79
  48. package/esm/components/Popper/index.js +2 -1
  49. package/esm/components/Section/Section.js +1 -2
  50. package/esm/components/Skeleton/SkeletonText.js +1 -1
  51. package/esm/components/SplitButton/SplitButton.js +10 -47
  52. package/esm/components/SplitButton/index.js +2 -1
  53. package/esm/components/index.js +2 -2
  54. package/esm/components/utils.js +1 -1
  55. package/esm/index.js +1 -1
  56. package/package.json +10 -13
  57. package/styleguide/build/bundle.2a886a79.js +2 -0
  58. package/styleguide/images/symbols.svg +9 -1
  59. package/styleguide/index.html +2 -2
  60. package/types/src/components/Button/Button.d.ts +4 -1
  61. package/types/src/components/ButtonGroup/ButtonGroup.d.ts +2 -2
  62. package/types/src/components/Dialog/Dialog.d.ts +29 -6
  63. package/types/src/components/Drawer/Drawer.d.ts +106 -0
  64. package/types/src/components/Drawer/DrawerProgress.d.ts +1 -1
  65. package/types/src/components/Drawer/Header.d.ts +28 -0
  66. package/types/src/components/Drawer/index.d.ts +2 -0
  67. package/types/src/components/Dropdown/Dropdown.d.ts +3 -4
  68. package/types/src/components/Dropdown/index.d.ts +2 -0
  69. package/types/src/components/Figure/Figure.d.ts +28 -0
  70. package/types/src/components/Figure/index.d.ts +2 -0
  71. package/types/src/components/Form/Form.d.ts +9 -104
  72. package/types/src/components/Form/ScrollableElementFormContext.d.ts +2 -0
  73. package/types/src/components/Form/index.d.ts +1 -0
  74. package/types/src/components/Form/types.d.ts +5 -3
  75. package/types/src/components/Icon/constants.d.ts +1 -1
  76. package/types/src/components/Link/Link.d.ts +14 -12
  77. package/types/src/components/Link/index.d.ts +1 -0
  78. package/types/src/components/Overlay/Overlay.d.ts +1 -1
  79. package/types/src/components/Popper/Popper.d.ts +96 -0
  80. package/types/src/components/Popper/index.d.ts +2 -0
  81. package/types/src/components/SplitButton/SplitButton.d.ts +53 -0
  82. package/types/src/components/SplitButton/index.d.ts +2 -0
  83. package/types/src/components/index.d.ts +11 -2
  84. package/types/src/components/utils.d.ts +6 -4
  85. package/dist/.DS_Store +0 -0
  86. package/dist/images/default.svg +0 -1
  87. package/dist/images/filtered.svg +0 -1
  88. package/styleguide/build/bundle.c6ebacd7.js +0 -2
  89. /package/styleguide/build/{bundle.c6ebacd7.js.LICENSE.txt → bundle.2a886a79.js.LICENSE.txt} +0 -0
@@ -1,19 +1,17 @@
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, Component, Fragment, createRef } from 'react';
5
- import { findDOMNode } from 'react-dom';
6
- import PropTypes from 'prop-types';
7
4
  import classNames from 'classnames';
8
- import { CLS_PREFIX } from '../../constants';
9
5
  import PopperJs from 'popper.js';
6
+ import { cloneElement, Component, createRef, Fragment } from 'react';
7
+ import { findDOMNode } from 'react-dom';
8
+ import { CLS_PREFIX } from '../../constants';
10
9
  import Layer from '../Layer';
11
-
10
+ import { jsxs as _jsxs } from "react/jsx-runtime";
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
12
  /**
13
13
  * `Popper` component.
14
14
  */
15
- import { jsxs as _jsxs } from "react/jsx-runtime";
16
- import { jsx as _jsx } from "react/jsx-runtime";
17
15
  class Popper extends Component {
18
16
  constructor() {
19
17
  super(...arguments);
@@ -24,29 +22,26 @@ class Popper extends Component {
24
22
  });
25
23
  _defineProperty(this, "popper", null);
26
24
  _defineProperty(this, "contentRef", /*#__PURE__*/createRef());
25
+ _defineProperty(this, "arrowRef", null);
26
+ // @ts-ignore
27
27
  _defineProperty(this, "extractStyles", state => {
28
- if (!state) {
29
- return;
30
- }
31
28
  const {
32
29
  onUpdate
33
30
  } = this.props;
34
31
  const data = {
35
32
  popperStyle: {
36
- position: state.offsets.popper.position,
37
33
  ...(state.hide ? {
38
34
  visibility: 'hidden',
39
35
  pointerEvents: 'none'
40
36
  } : undefined),
41
- ...state.styles
37
+ ...state.styles,
38
+ position: state.offsets.popper.position
42
39
  },
43
40
  actualPlacement: state.placement,
44
41
  arrowStyle: state.arrowStyles
45
42
  };
46
43
  this.setState(data);
47
- if (onUpdate) {
48
- onUpdate(data);
49
- }
44
+ onUpdate?.(data);
50
45
  });
51
46
  }
52
47
  componentDidMount() {
@@ -116,10 +111,10 @@ class Popper extends Component {
116
111
  padding: 0,
117
112
  behavior
118
113
  },
119
- arrow: arrow && {
114
+ arrow: arrow && this.arrowRef ? {
120
115
  enabled: true,
121
116
  element: this.arrowRef
122
- }
117
+ } : undefined
123
118
  }
124
119
  };
125
120
  let reference;
@@ -179,67 +174,7 @@ class Popper extends Component {
179
174
  });
180
175
  }
181
176
  }
182
- Popper.propTypes = {
183
- /**
184
- * Whether show popper content.
185
- */
186
- show: PropTypes.bool,
187
- /**
188
- * Content of the `Popper`.
189
- */
190
- children: PropTypes.node,
191
- /**
192
- * Target for popper.
193
- */
194
- target: PropTypes.any.isRequired,
195
- /**
196
- * A React reference to the DOM element that needs for calculating the position of the popup.
197
- */
198
- targetRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
199
- current: PropTypes.instanceOf(HTMLElement)
200
- })]),
201
- /**
202
- * Arrow element of popper
203
- */
204
- arrow: PropTypes.element,
205
- /**
206
- * Placement for popper.
207
- */
208
- placement: PropTypes.oneOf(['auto', 'auto-start', 'auto-end', 'auto-top', 'auto-right', 'auto-bottom', 'auto-left', 'top', 'top-start', 'top-end', 'right', 'right-start', 'right-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end']),
209
- /**
210
- * The behavior used to change the popper's placement.
211
- */
212
- behavior: PropTypes.oneOfType([PropTypes.oneOf(['flip', 'clockwise', 'counterclockwise']), PropTypes.arrayOf(PropTypes.string)]),
213
- /**
214
- * Shift your popper on both axis.
215
- */
216
- offset: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
217
- /**
218
- * Update callback function
219
- */
220
- onUpdate: PropTypes.func,
221
- /**
222
- * @ignore
223
- */
224
- className: PropTypes.string,
225
- /**
226
- * @ignore
227
- */
228
- baseClassName: PropTypes.string,
229
- /**
230
- * zIndex value.
231
- */
232
- zIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
233
- /**
234
- * Boundaries element for preventOverflow property.
235
- */
236
- boundariesElement: PropTypes.oneOfType([PropTypes.oneOf(['scrollParent', 'window', 'viewport']), PropTypes.instanceOf(HTMLElement)]),
237
- /**
238
- * @ignore
239
- */
240
- style: PropTypes.object
241
- };
242
- Popper.defaultProps = {
177
+ _defineProperty(Popper, "defaultProps", {
243
178
  show: true,
244
179
  children: null,
245
180
  arrow: null,
@@ -253,5 +188,5 @@ Popper.defaultProps = {
253
188
  boundariesElement: 'window',
254
189
  style: undefined,
255
190
  targetRef: undefined
256
- };
191
+ });
257
192
  export default Popper;
@@ -1,3 +1,4 @@
1
1
  // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
2
2
 
3
- export { default } from './Popper';
3
+ export { default } from './Popper';
4
+ export * from './Popper';
@@ -139,8 +139,7 @@ class Section extends Component {
139
139
  value: title,
140
140
  onChange: onTitleChange,
141
141
  onClick: e => {
142
- var _e$target$closest$que;
143
- (_e$target$closest$que = e.target.closest(`.${baseClassName}__header`).querySelector(`.${baseClassName}__control-button`)) === null || _e$target$closest$que === void 0 ? void 0 : _e$target$closest$que.click();
142
+ e.target.closest(`.${baseClassName}__header`).querySelector(`.${baseClassName}__control-button`)?.click();
144
143
  }
145
144
  });
146
145
  }
@@ -26,7 +26,7 @@ const SkeletonText = _ref => {
26
26
  // eslint-disable-next-line react/no-array-index-key
27
27
  , {
28
28
  ...lineProps,
29
- className: classNames(`${baseClassName}__line`, lineProps === null || lineProps === void 0 ? void 0 : lineProps.className)
29
+ className: classNames(`${baseClassName}__line`, lineProps?.className)
30
30
  }, key))
31
31
  });
32
32
  };
@@ -1,7 +1,6 @@
1
1
  // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
2
2
 
3
- import React, { useRef } from 'react';
4
- import PropTypes from 'prop-types';
3
+ import { useRef } from 'react';
5
4
  import classNames from 'classnames';
6
5
  import { CLS_PREFIX } from '../../constants';
7
6
  import Button from '../Button';
@@ -32,25 +31,26 @@ const focusStrategy = {
32
31
  return container.children[1].querySelector('button');
33
32
  }
34
33
  };
35
-
36
34
  /**
37
35
  * `Split Button` is a combination of a standard [Button](#!/Button) with a [Dropdown](#!/Dropdown) menu.
38
36
  * It is used for grouping several related actions when one of the actions should be accessible immediately
39
37
  * because it is used more often than others.
40
- * @since 0.0.40
38
+ *
39
+ * Since: 0.0.40
41
40
  */
42
41
  const SplitButton = _ref => {
43
42
  let {
44
- baseClassName,
43
+ baseClassName = `${CLS_PREFIX}split-button`,
45
44
  className,
46
45
  menu,
47
46
  children,
48
- opened,
49
47
  onClick,
50
48
  onKeyDown,
49
+ icon,
50
+ size,
51
51
  ...props
52
52
  } = _ref;
53
- const rootRef = useRef();
53
+ const rootRef = useRef(null);
54
54
  const {
55
55
  focusNext,
56
56
  focusPrev
@@ -74,6 +74,8 @@ const SplitButton = _ref => {
74
74
  onKeyDown: handleKeyDown,
75
75
  ...props,
76
76
  children: [/*#__PURE__*/_jsx(Button, {
77
+ icon: icon,
78
+ size: size,
77
79
  tabIndex: 0,
78
80
  onClick: onClick,
79
81
  children: children
@@ -82,50 +84,11 @@ const SplitButton = _ref => {
82
84
  menu: menu,
83
85
  menuPlacement: "bottom-end",
84
86
  children: /*#__PURE__*/_jsx(Button, {
87
+ size: size,
85
88
  caret: true,
86
89
  tabIndex: -1
87
90
  })
88
91
  })]
89
92
  });
90
93
  };
91
- SplitButton.propTypes = {
92
- /**
93
- * @since 0.0.47
94
- */
95
- menu: PropTypes.any,
96
- /**
97
- * @since 0.0.47
98
- */
99
- opened: PropTypes.bool,
100
- /**
101
- * Content of the button group
102
- * @since 0.0.40
103
- */
104
- children: PropTypes.node,
105
- /**
106
- * @ignore
107
- */
108
- className: PropTypes.string,
109
- /**
110
- * @ignore
111
- */
112
- baseClassName: PropTypes.string,
113
- /**
114
- * @ignore
115
- */
116
- onClick: PropTypes.func,
117
- /**
118
- * @ignore
119
- */
120
- onKeyDown: PropTypes.func
121
- };
122
- SplitButton.defaultProps = {
123
- menu: null,
124
- opened: false,
125
- children: null,
126
- className: null,
127
- baseClassName: `${CLS_PREFIX}split-button`,
128
- onClick: undefined,
129
- onKeyDown: undefined
130
- };
131
94
  export default SplitButton;
@@ -1,3 +1,4 @@
1
1
  // Copyright 1999-2023. Plesk International GmbH. All rights reserved.
2
2
 
3
- export { default } from './SplitButton';
3
+ export { default } from './SplitButton';
4
+ export * from './SplitButton';
@@ -6,7 +6,7 @@ export { default as AutoClosable } from './AutoClosable';
6
6
  export { default as AuxiliaryActions } from './AuxiliaryActions';
7
7
  export { default as Badge } from './Badge';
8
8
  export { default as Breadcrumbs } from './Breadcrumbs';
9
- export { default as Button, ButtonProps } from './Button';
9
+ export { default as Button } from './Button';
10
10
  export { default as ButtonGroup } from './ButtonGroup';
11
11
  export { default as Card } from './Card';
12
12
  export * from './Card';
@@ -42,7 +42,7 @@ export { default as Grid } from './Grid';
42
42
  export { default as GridCol } from './GridCol';
43
43
  export { default as Heading } from './Heading';
44
44
  export { default as Hint } from './Hint';
45
- export { default as Icon, IconProps, IconName, IconSize } from './Icon';
45
+ export { default as Icon } from './Icon';
46
46
  export { default as Input } from './Input';
47
47
  export { default as InputFile } from './InputFile';
48
48
  export { default as InputNumber } from './InputNumber';
@@ -109,7 +109,7 @@ const createStrategy = () => {
109
109
  };
110
110
  };
111
111
  export const createFocusManager = function (containerRef) {
112
- let isFitForFocus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _node => true;
112
+ let isFitForFocus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : () => true;
113
113
  let strategy = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : createStrategy();
114
114
  const tryFocus = node => {
115
115
  if (isFitForFocus(node) && node instanceof HTMLElement) {
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.34.1";
3
+ const version = "3.35.0";
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.34.1",
3
+ "version": "3.35.0",
4
4
  "description": "Plesk UI Library",
5
5
  "main": "index.js",
6
6
  "module": "esm/index.js",
@@ -42,7 +42,7 @@
42
42
  "/index.js"
43
43
  ],
44
44
  "dependencies": {
45
- "@babel/runtime": "^7.22.5",
45
+ "@babel/runtime": "^7.22.6",
46
46
  "@plesk/react-movable": "^2.7.1",
47
47
  "classnames": "^2.3.2",
48
48
  "codemirror": "5.58.2",
@@ -58,11 +58,11 @@
58
58
  "use-focus-visible": "^1.0.2"
59
59
  },
60
60
  "devDependencies": {
61
- "@babel/core": "^7.22.5",
61
+ "@babel/core": "^7.22.9",
62
62
  "@babel/plugin-proposal-class-properties": "^7.18.6",
63
63
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
64
- "@babel/plugin-transform-runtime": "^7.22.5",
65
- "@babel/preset-env": "^7.22.5",
64
+ "@babel/plugin-transform-runtime": "^7.22.9",
65
+ "@babel/preset-env": "^7.22.9",
66
66
  "@babel/preset-react": "^7.22.5",
67
67
  "@babel/preset-typescript": "^7.22.5",
68
68
  "@babel/types": "^7.22.5",
@@ -70,7 +70,6 @@
70
70
  "@plesk/eslint-config": "^3.0.0",
71
71
  "@plesk/stylelint-config": "^2.0.0",
72
72
  "@types/buble": "^0.20.1",
73
- "@types/cheerio": "^0.22.31",
74
73
  "@types/classnames": "2.3.1",
75
74
  "@types/doctrine": "^0.0.5",
76
75
  "@types/enzyme": "^3.10.13",
@@ -83,12 +82,11 @@
83
82
  "@types/react-measure": "2.0.8",
84
83
  "@types/react-transition-group": "^4.4.6",
85
84
  "@types/svg4everybody": "2.1.2",
86
- "@typescript-eslint/eslint-plugin": "^5.60.1",
87
- "@typescript-eslint/parser": "^5.60.1",
85
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
86
+ "@typescript-eslint/parser": "^5.62.0",
88
87
  "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
89
88
  "autoprefixer": "^10.4.14",
90
89
  "babel-loader": "^8.3.0",
91
- "babel-plugin-dynamic-import-node": "^2.3.3",
92
90
  "babel-plugin-transform-require-ignore": "^0.1.1",
93
91
  "clean-webpack-plugin": "^4.0.0",
94
92
  "cross-env": "^5.2.1",
@@ -96,7 +94,7 @@
96
94
  "css-minimizer-webpack-plugin": "^5.0.1",
97
95
  "enzyme": "^3.11.0",
98
96
  "enzyme-to-json": "^3.6.2",
99
- "eslint": "^8.44.0",
97
+ "eslint": "^8.45.0",
100
98
  "eslint-config-prettier": "^8.8.0",
101
99
  "eslint-plugin-markdown": "^3.0.0",
102
100
  "eslint-plugin-prettier": "^4.2.1",
@@ -109,7 +107,7 @@
109
107
  "less": "^4.1.3",
110
108
  "less-loader": "^11.1.3",
111
109
  "mini-css-extract-plugin": "^2.7.6",
112
- "postcss": "^8.4.24",
110
+ "postcss": "^8.4.26",
113
111
  "postcss-less": "^6.0.0",
114
112
  "postcss-loader": "^7.3.3",
115
113
  "postcss-logical": "^6.2.0",
@@ -119,11 +117,10 @@
119
117
  "react-docgen-typescript": "^2.2.2",
120
118
  "react-dom": "^17.0.2",
121
119
  "react-styleguidist": "^12.0.1",
122
- "react-test-renderer": "^16.14.0",
123
120
  "rimraf": "^5.0.1",
124
121
  "rtlcss": "^4.1.0",
125
122
  "style-loader": "^3.3.3",
126
- "stylelint": "^15.9.0",
123
+ "stylelint": "^15.10.1",
127
124
  "stylelint-declaration-block-no-ignored-properties": "^2.7.0",
128
125
  "stylelint-no-unsupported-browser-features": "^6.1.0",
129
126
  "stylelint-prettier": "^3.0.0",