@plesk/ui-library 3.40.5 → 3.40.7
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.
- package/cjs/components/Badge/Badge.js +2 -2
- package/cjs/components/Carousel/Carousel.js +0 -14
- package/cjs/components/LocaleProvider/LocaleProvider.js +17 -1
- package/cjs/components/SegmentedControl/SegmentedControl.js +12 -10
- package/cjs/components/StatusMessage/StatusMessage.js +1 -0
- package/cjs/components/Subnav/Subnav.js +1 -1
- package/cjs/components/Tabs/SearchBar.js +12 -13
- package/cjs/components/Toolbar/RegistryContext.js +90 -31
- package/cjs/components/Toolbar/Toolbar.js +5 -80
- package/cjs/components/Toolbar/ToolbarGroup.js +6 -159
- package/cjs/components/Toolbar/ToolbarItem.js +15 -59
- package/cjs/components/index.js +21 -11
- package/cjs/hooks/useSqueeze.js +3 -1
- package/cjs/index.js +1 -1
- package/dist/plesk-ui-library-rtl.css +1 -1
- package/dist/plesk-ui-library-rtl.css.map +1 -1
- package/dist/plesk-ui-library.css +1 -1
- package/dist/plesk-ui-library.css.map +1 -1
- package/dist/plesk-ui-library.js +103 -420
- package/dist/plesk-ui-library.js.map +1 -1
- package/dist/plesk-ui-library.min.js +6 -6
- package/dist/plesk-ui-library.min.js.map +1 -1
- package/esm/components/Badge/Badge.js +2 -2
- package/esm/components/Carousel/Carousel.js +0 -14
- package/esm/components/LocaleProvider/LocaleProvider.js +16 -1
- package/esm/components/SegmentedControl/SegmentedControl.js +12 -10
- package/esm/components/StatusMessage/StatusMessage.js +1 -0
- package/esm/components/Subnav/Subnav.js +1 -1
- package/esm/components/Tabs/SearchBar.js +12 -13
- package/esm/components/Toolbar/RegistryContext.js +87 -30
- package/esm/components/Toolbar/Toolbar.js +7 -82
- package/esm/components/Toolbar/ToolbarGroup.js +7 -160
- package/esm/components/Toolbar/ToolbarItem.js +15 -59
- package/esm/components/index.js +1 -2
- package/esm/hooks/useSqueeze.js +3 -1
- package/esm/index.js +1 -1
- package/package.json +23 -25
- package/styleguide/build/bundle.52d1d9a1.js +2 -0
- package/styleguide/index.html +2 -2
- package/types/src/components/LocaleProvider/LocaleProvider.d.ts +1 -0
- package/types/src/components/Toolbar/RegistryContext.d.ts +22 -13
- package/types/src/components/Toolbar/Toolbar.d.ts +8 -8
- package/types/src/components/Toolbar/ToolbarGroup.d.ts +6 -16
- package/types/src/components/Toolbar/ToolbarItem.d.ts +1 -1
- package/types/src/components/index.d.ts +2 -2
- package/cjs/components/Toolbar/RegistryContextBeta.js +0 -112
- package/esm/components/Toolbar/RegistryContextBeta.js +0 -103
- package/styleguide/build/bundle.f0d21187.js +0 -2
- package/types/src/components/Toolbar/RegistryContextBeta.d.ts +0 -25
- /package/styleguide/build/{bundle.f0d21187.js.LICENSE.txt → bundle.52d1d9a1.js.LICENSE.txt} +0 -0
|
@@ -1,54 +1,14 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
3
2
|
|
|
4
|
-
import {
|
|
3
|
+
import { isValidElement, Children, cloneElement } from 'react';
|
|
5
4
|
import classNames from 'classnames';
|
|
6
5
|
import { CLS_PREFIX } from '../../constants';
|
|
7
6
|
import ResponsiveContext from '../ResponsiveContext';
|
|
8
|
-
import RegistryContext from './RegistryContext';
|
|
9
7
|
import ToolbarGroup from './ToolbarGroup';
|
|
10
8
|
import ToolbarExpander from './ToolbarExpander';
|
|
11
|
-
import { useRegistryItem } from './
|
|
9
|
+
import { useRegistryItem } from './RegistryContext';
|
|
12
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
_defineProperty(this, "state", {
|
|
17
|
-
compact: false
|
|
18
|
-
});
|
|
19
|
-
_defineProperty(this, "context", void 0);
|
|
20
|
-
}
|
|
21
|
-
componentDidMount() {
|
|
22
|
-
const registry = this.context;
|
|
23
|
-
registry.register(this);
|
|
24
|
-
}
|
|
25
|
-
componentWillUnmount() {
|
|
26
|
-
const registry = this.context;
|
|
27
|
-
registry.unregister(this);
|
|
28
|
-
}
|
|
29
|
-
isCompact() {
|
|
30
|
-
return this.state.compact;
|
|
31
|
-
}
|
|
32
|
-
setCompact(compact) {
|
|
33
|
-
this.setState({
|
|
34
|
-
compact
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
render() {
|
|
38
|
-
const {
|
|
39
|
-
children
|
|
40
|
-
} = this.props;
|
|
41
|
-
const {
|
|
42
|
-
compact
|
|
43
|
-
} = this.state;
|
|
44
|
-
return /*#__PURE__*/_jsx(ResponsiveContext.Provider, {
|
|
45
|
-
value: compact,
|
|
46
|
-
children: children
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
ToolbarItem.contextType = RegistryContext;
|
|
51
|
-
const ToolbarItemBeta = _ref => {
|
|
11
|
+
const ToolbarItem = _ref => {
|
|
52
12
|
let {
|
|
53
13
|
children
|
|
54
14
|
} = _ref;
|
|
@@ -58,20 +18,16 @@ const ToolbarItemBeta = _ref => {
|
|
|
58
18
|
children: children
|
|
59
19
|
});
|
|
60
20
|
};
|
|
61
|
-
export const toToolbarItems =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
children: /*#__PURE__*/cloneElement(child, {
|
|
73
|
-
className: classNames(child.props.className, `${CLS_PREFIX}toolbar__group-item`)
|
|
74
|
-
})
|
|
75
|
-
});
|
|
21
|
+
export const toToolbarItems = children => Children.map(children, child => {
|
|
22
|
+
if (! /*#__PURE__*/isValidElement(child)) {
|
|
23
|
+
return child;
|
|
24
|
+
}
|
|
25
|
+
if (child.type === ToolbarGroup || child.type === ToolbarExpander) {
|
|
26
|
+
return child;
|
|
27
|
+
}
|
|
28
|
+
return /*#__PURE__*/_jsx(ToolbarItem, {
|
|
29
|
+
children: /*#__PURE__*/cloneElement(child, {
|
|
30
|
+
className: classNames(child.props.className, `${CLS_PREFIX}toolbar__group-item`)
|
|
31
|
+
})
|
|
76
32
|
});
|
|
77
|
-
};
|
|
33
|
+
});
|
package/esm/components/index.js
CHANGED
|
@@ -53,8 +53,7 @@ export { default as ItemList } from './ItemList';
|
|
|
53
53
|
export { default as Label } from './Label';
|
|
54
54
|
export { default as Layout } from './Layout';
|
|
55
55
|
export { default as List, ListActions, ListAction, ListOperation, ListEmptyView, ListActionsDivider } from './List';
|
|
56
|
-
export { default as LocaleProvider } from './LocaleProvider';
|
|
57
|
-
export * from './LocaleProvider';
|
|
56
|
+
export { default as LocaleProvider, useTranslate, LocaleContext, LocaleBetaProvider } from './LocaleProvider';
|
|
58
57
|
export { default as Markdown } from './Markdown';
|
|
59
58
|
export { default as Media, MediaSection } from './Media';
|
|
60
59
|
export { default as Menu, MenuDivider, MenuHeader, MenuItem, MenuSelectableItem, MenuBaseItem } from './Menu';
|
package/esm/hooks/useSqueeze.js
CHANGED
|
@@ -21,7 +21,9 @@ export const useSqueeze = _ref => {
|
|
|
21
21
|
if (!ref.current) return;
|
|
22
22
|
const root = ref.current;
|
|
23
23
|
const width = Math.ceil(root.getBoundingClientRect().width);
|
|
24
|
-
const
|
|
24
|
+
const {
|
|
25
|
+
scrollWidth
|
|
26
|
+
} = root;
|
|
25
27
|
let isCompactChanged = false;
|
|
26
28
|
if (scrollWidth > width) {
|
|
27
29
|
isCompactChanged = compact();
|
package/esm/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plesk/ui-library",
|
|
3
|
-
"version": "3.40.
|
|
3
|
+
"version": "3.40.7",
|
|
4
4
|
"description": "Plesk UI Library",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"format:check": "prettier --check src",
|
|
29
29
|
"format": "prettier --write src",
|
|
30
30
|
"styleguide": "styleguidist server --config ./configs/styleguide.config.js",
|
|
31
|
-
"styleguide:build": "styleguidist build --config ./configs/styleguide.config.js",
|
|
31
|
+
"styleguide:build": "rimraf ./styleguide && styleguidist build --config ./configs/styleguide.config.js",
|
|
32
32
|
"prepublishOnly": "yarn install && yarn test && yarn build && yarn styleguide:build",
|
|
33
33
|
"storybook": "webpack serve --config ./configs/storybook.config.js --allowed-hosts all",
|
|
34
34
|
"postinstall": "node ./scripts/postinstall.js"
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"/index.js"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@babel/runtime": "^7.
|
|
46
|
+
"@babel/runtime": "^7.25.0",
|
|
47
47
|
"@plesk/react-movable": "^2.7.1",
|
|
48
48
|
"classnames": "^2.5.1",
|
|
49
49
|
"codemirror": "5.58.2",
|
|
@@ -59,19 +59,19 @@
|
|
|
59
59
|
"use-focus-visible": "^1.0.2"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@babel/core": "^7.24.
|
|
62
|
+
"@babel/core": "^7.24.9",
|
|
63
63
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
64
64
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
65
65
|
"@babel/plugin-transform-runtime": "^7.24.7",
|
|
66
|
-
"@babel/preset-env": "^7.
|
|
66
|
+
"@babel/preset-env": "^7.25.0",
|
|
67
67
|
"@babel/preset-react": "^7.24.7",
|
|
68
68
|
"@babel/preset-typescript": "^7.24.7",
|
|
69
|
-
"@babel/types": "^7.
|
|
70
|
-
"@csstools/postcss-logical-float-and-clear": "^
|
|
69
|
+
"@babel/types": "^7.25.0",
|
|
70
|
+
"@csstools/postcss-logical-float-and-clear": "^2.0.1",
|
|
71
71
|
"@plesk/eslint-config": "^3.0.0",
|
|
72
72
|
"@plesk/stylelint-config": "^2.0.0",
|
|
73
73
|
"@testing-library/dom": "^9.3.4",
|
|
74
|
-
"@testing-library/jest-dom": "^6.4.
|
|
74
|
+
"@testing-library/jest-dom": "^6.4.8",
|
|
75
75
|
"@testing-library/react": "^14.3.1",
|
|
76
76
|
"@testing-library/user-event": "^14.5.2",
|
|
77
77
|
"@types/buble": "^0.20.5",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@types/jest": "^29.5.12",
|
|
82
82
|
"@types/jest-image-snapshot": "^6.4.0",
|
|
83
83
|
"@types/marked": "^4.3.2",
|
|
84
|
-
"@types/node": "^
|
|
84
|
+
"@types/node": "^22.1.0",
|
|
85
85
|
"@types/react": "^18.3.3",
|
|
86
86
|
"@types/react-dom": "^18.3.0",
|
|
87
87
|
"@types/react-measure": "2.0.9",
|
|
@@ -93,34 +93,33 @@
|
|
|
93
93
|
"autoprefixer": "^10.4.19",
|
|
94
94
|
"babel-loader": "^8.3.0",
|
|
95
95
|
"babel-plugin-transform-require-ignore": "^0.1.1",
|
|
96
|
-
"clean-webpack-plugin": "^4.0.0",
|
|
97
96
|
"cross-env": "^7.0.3",
|
|
98
|
-
"css-loader": "^
|
|
99
|
-
"css-minimizer-webpack-plugin": "^
|
|
97
|
+
"css-loader": "^7.1.2",
|
|
98
|
+
"css-minimizer-webpack-plugin": "^7.0.0",
|
|
100
99
|
"eslint": "^8.57.0",
|
|
101
100
|
"eslint-config-prettier": "^8.10.0",
|
|
102
101
|
"eslint-plugin-markdown": "^3.0.1",
|
|
103
102
|
"html-webpack-plugin": "^5.6.0",
|
|
104
103
|
"jest": "^29.7.0",
|
|
105
|
-
"jest-dev-server": "^
|
|
104
|
+
"jest-dev-server": "^10.0.0",
|
|
106
105
|
"jest-environment-jsdom": "^29.7.0",
|
|
107
106
|
"jest-image-snapshot": "^6.4.0",
|
|
108
107
|
"less": "^4.2.0",
|
|
109
|
-
"less-loader": "^
|
|
108
|
+
"less-loader": "^12.2.0",
|
|
110
109
|
"mini-css-extract-plugin": "^2.9.0",
|
|
111
|
-
"postcss": "^8.4.
|
|
110
|
+
"postcss": "^8.4.40",
|
|
112
111
|
"postcss-less": "^6.0.0",
|
|
113
|
-
"postcss-loader": "^
|
|
114
|
-
"postcss-logical": "^
|
|
112
|
+
"postcss-loader": "^8.1.1",
|
|
113
|
+
"postcss-logical": "^7.0.1",
|
|
115
114
|
"prettier": "^2.8.8",
|
|
116
|
-
"puppeteer-core": "
|
|
115
|
+
"puppeteer-core": "22.8.2",
|
|
117
116
|
"react": "^18.3.1",
|
|
118
117
|
"react-docgen-typescript": "^2.2.2",
|
|
119
118
|
"react-dom": "^18.3.1",
|
|
120
|
-
"react-styleguidist": "^13.1.
|
|
121
|
-
"rimraf": "^
|
|
122
|
-
"rtlcss": "^4.
|
|
123
|
-
"style-loader": "^
|
|
119
|
+
"react-styleguidist": "^13.1.3",
|
|
120
|
+
"rimraf": "^6.0.1",
|
|
121
|
+
"rtlcss": "^4.2.0",
|
|
122
|
+
"style-loader": "^4.0.0",
|
|
124
123
|
"stylelint": "^15.11.0",
|
|
125
124
|
"stylelint-declaration-block-no-ignored-properties": "^2.8.0",
|
|
126
125
|
"stylelint-no-unsupported-browser-features": "^6.1.0",
|
|
@@ -129,7 +128,7 @@
|
|
|
129
128
|
"svg-mixer": "^2.3.14",
|
|
130
129
|
"terser-webpack-plugin": "^5.3.10",
|
|
131
130
|
"typescript": "5.2.2",
|
|
132
|
-
"webpack": "^5.
|
|
131
|
+
"webpack": "^5.93.0",
|
|
133
132
|
"webpack-cli": "^5.1.4"
|
|
134
133
|
},
|
|
135
134
|
"peerDependencies": {
|
|
@@ -137,8 +136,7 @@
|
|
|
137
136
|
"react-dom": "^18.2.0"
|
|
138
137
|
},
|
|
139
138
|
"resolutions": {
|
|
140
|
-
"trim": ">=0.0.3"
|
|
141
|
-
"postcss": "^8.4.23"
|
|
139
|
+
"trim": ">=0.0.3"
|
|
142
140
|
},
|
|
143
141
|
"browserslist": [
|
|
144
142
|
"defaults",
|