@plesk/ui-library 3.38.2 → 3.40.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.
- package/cjs/components/Button/Button.js +4 -22
- package/cjs/components/Card/CardButton.js +2 -3
- package/cjs/components/CardList/CardListToolbar.js +3 -8
- package/cjs/components/Dialog/Dialog.js +5 -27
- package/cjs/components/Drawer/Drawer.js +7 -20
- package/cjs/components/Dropdown/Dropdown.js +3 -11
- package/cjs/components/FormField/FormField.js +13 -26
- package/cjs/components/Icon/constants.js +2 -2
- package/cjs/components/Icon/images/symbols.svg +9 -1
- package/cjs/components/List/List.js +1 -14
- package/cjs/components/Progress/Progress.js +6 -5
- package/cjs/components/ProgressStep/ProgressStep.js +5 -14
- package/cjs/components/ProgressStep/index.js +6 -0
- package/cjs/components/Section/Section.js +11 -19
- package/cjs/components/SplitButton/SplitButton.js +2 -3
- package/cjs/components/TextArea/TextArea.js +49 -97
- package/cjs/components/TextArea/calculateNodeHeight.js +8 -8
- package/cjs/components/Toolbar/RegistryContextBeta.js +112 -0
- package/cjs/components/Toolbar/Toolbar.js +46 -2
- package/cjs/components/Toolbar/ToolbarBetaProvider.js +23 -0
- package/cjs/components/Toolbar/ToolbarGroup.js +66 -4
- package/cjs/components/Toolbar/ToolbarItem.js +27 -12
- package/cjs/components/Toolbar/ToolbarMenu.js +2 -1
- package/cjs/components/Toolbar/index.js +8 -1
- package/cjs/components/index.js +15 -1
- package/cjs/hooks/index.js +12 -0
- package/cjs/hooks/useResizeObserver.js +29 -0
- package/cjs/hooks/useSqueeze.js +48 -0
- package/cjs/index.js +1 -1
- package/dist/images/symbols.svg +9 -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 +591 -309
- package/dist/plesk-ui-library.js.map +1 -1
- package/dist/plesk-ui-library.min.js +5 -5
- package/dist/plesk-ui-library.min.js.map +1 -1
- package/esm/components/Button/Button.js +3 -21
- package/esm/components/Card/CardButton.js +2 -3
- package/esm/components/CardList/CardListToolbar.js +3 -8
- package/esm/components/Dialog/Dialog.js +5 -27
- package/esm/components/Drawer/Drawer.js +7 -20
- package/esm/components/Dropdown/Dropdown.js +3 -11
- package/esm/components/FormField/FormField.js +13 -26
- package/esm/components/Icon/constants.js +2 -2
- package/esm/components/Icon/images/symbols.svg +9 -1
- package/esm/components/List/List.js +1 -14
- package/esm/components/Progress/Progress.js +7 -6
- package/esm/components/ProgressStep/ProgressStep.js +4 -13
- package/esm/components/ProgressStep/index.js +1 -1
- package/esm/components/Section/Section.js +11 -19
- package/esm/components/SplitButton/SplitButton.js +2 -3
- package/esm/components/TextArea/TextArea.js +50 -98
- package/esm/components/TextArea/calculateNodeHeight.js +8 -8
- package/esm/components/Toolbar/RegistryContextBeta.js +103 -0
- package/esm/components/Toolbar/Toolbar.js +47 -3
- package/esm/components/Toolbar/ToolbarBetaProvider.js +16 -0
- package/esm/components/Toolbar/ToolbarGroup.js +67 -5
- package/esm/components/Toolbar/ToolbarItem.js +27 -12
- package/esm/components/Toolbar/ToolbarMenu.js +2 -1
- package/esm/components/Toolbar/index.js +2 -1
- package/esm/components/index.js +2 -2
- package/esm/hooks/index.js +3 -0
- package/esm/hooks/useResizeObserver.js +22 -0
- package/esm/hooks/useSqueeze.js +41 -0
- package/esm/index.js +1 -1
- package/package.json +13 -13
- package/styleguide/build/bundle.8f00c54c.js +2 -0
- package/styleguide/images/symbols.svg +9 -1
- package/styleguide/index.html +2 -2
- package/types/src/components/Button/Button.d.ts +1 -0
- package/types/src/components/Dialog/Dialog.d.ts +1 -25
- package/types/src/components/Drawer/Drawer.d.ts +1 -4
- package/types/src/components/FormField/FormField.d.ts +1 -23
- package/types/src/components/Icon/constants.d.ts +1 -1
- package/types/src/components/ProgressStep/ProgressStep.d.ts +2 -13
- package/types/src/components/ProgressStep/index.d.ts +1 -1
- package/types/src/components/Section/Section.d.ts +2 -32
- package/types/src/components/TextArea/TextArea.d.ts +5 -32
- package/types/src/components/TextArea/calculateNodeHeight.d.ts +2 -6
- package/types/src/components/Toolbar/RegistryContextBeta.d.ts +25 -0
- package/types/src/components/Toolbar/Toolbar.d.ts +2 -22
- package/types/src/components/Toolbar/ToolbarBetaProvider.d.ts +5 -0
- package/types/src/components/Toolbar/ToolbarGroup.d.ts +2 -5
- package/types/src/components/Toolbar/ToolbarItem.d.ts +1 -1
- package/types/src/components/Toolbar/index.d.ts +1 -0
- package/types/src/components/index.d.ts +2 -2
- package/types/src/hooks/index.d.ts +1 -0
- package/types/src/hooks/useResizeObserver.d.ts +7 -0
- package/types/src/hooks/useSqueeze.d.ts +10 -0
- package/styleguide/build/bundle.42040fbd.js +0 -2
- /package/styleguide/build/{bundle.42040fbd.js.LICENSE.txt → bundle.8f00c54c.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "useSqueeze", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _useSqueeze.useSqueeze;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _useSqueeze = require("./useSqueeze");
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useResizeObserver = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
// Copyright 1999-2024. Plesk International GmbH. All rights reserved.
|
|
9
|
+
|
|
10
|
+
const useResizeObserver = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
ref,
|
|
13
|
+
onResize
|
|
14
|
+
} = _ref;
|
|
15
|
+
const onResizeRef = (0, _react.useRef)(undefined);
|
|
16
|
+
onResizeRef.current = onResize;
|
|
17
|
+
(0, _react.useEffect)(() => {
|
|
18
|
+
if (!ref.current) return undefined;
|
|
19
|
+
if (typeof window === 'undefined' || !('ResizeObserver' in window)) return undefined;
|
|
20
|
+
const observer = new ResizeObserver(() => {
|
|
21
|
+
onResizeRef.current?.();
|
|
22
|
+
});
|
|
23
|
+
observer.observe(ref.current);
|
|
24
|
+
return () => {
|
|
25
|
+
observer.disconnect();
|
|
26
|
+
};
|
|
27
|
+
}, [ref]);
|
|
28
|
+
};
|
|
29
|
+
exports.useResizeObserver = useResizeObserver;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useSqueeze = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _useResizeObserver = require("./useResizeObserver");
|
|
9
|
+
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
10
|
+
|
|
11
|
+
const useSqueeze = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
ref,
|
|
14
|
+
compact,
|
|
15
|
+
expand
|
|
16
|
+
} = _ref;
|
|
17
|
+
const minWidth = (0, _react.useRef)(0);
|
|
18
|
+
const lastAction = (0, _react.useRef)(null);
|
|
19
|
+
const [recheck, setRecheck] = (0, _react.useState)(false);
|
|
20
|
+
const checkRef = (0, _react.useRef)();
|
|
21
|
+
const check = () => {
|
|
22
|
+
if (!ref.current) return;
|
|
23
|
+
const root = ref.current;
|
|
24
|
+
const width = Math.ceil(root.getBoundingClientRect().width);
|
|
25
|
+
const scrollWidth = Math.floor(root.scrollWidth);
|
|
26
|
+
let isCompactChanged = false;
|
|
27
|
+
if (scrollWidth > width) {
|
|
28
|
+
isCompactChanged = compact();
|
|
29
|
+
minWidth.current = scrollWidth;
|
|
30
|
+
lastAction.current = 'compact';
|
|
31
|
+
} else if (minWidth.current && width > minWidth.current || lastAction.current === 'expand') {
|
|
32
|
+
isCompactChanged = expand();
|
|
33
|
+
lastAction.current = 'expand';
|
|
34
|
+
}
|
|
35
|
+
if (isCompactChanged) {
|
|
36
|
+
setRecheck(c => !c);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
checkRef.current = check;
|
|
40
|
+
(0, _react.useLayoutEffect)(() => {
|
|
41
|
+
checkRef.current?.();
|
|
42
|
+
}, [recheck]);
|
|
43
|
+
(0, _useResizeObserver.useResizeObserver)({
|
|
44
|
+
ref,
|
|
45
|
+
onResize: check
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
exports.useSqueeze = useSqueeze;
|
package/cjs/index.js
CHANGED
package/dist/images/symbols.svg
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg width="16" height="
|
|
1
|
+
<svg width="16" height="12480" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
2
2
|
<defs>
|
|
3
3
|
<symbol viewBox="0 0 12 12" id="advisor:12">
|
|
4
4
|
<path d="M4.5 6.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0ZM8 7a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1Z" />
|
|
@@ -244,6 +244,14 @@
|
|
|
244
244
|
<path fill-rule="evenodd" d="M2 1a1 1 0 0 1 1-1h9a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H3a1 1 0 0 1-1-1V1zm1 12V1h9a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3zm10 .733V14a1 1 0 0 1-1 1H3v-1h9c.364 0 .706-.097 1-.267z" clip-rule="evenodd" />
|
|
245
245
|
<path fill-rule="evenodd" d="M8 10a3 3 0 0 0 .878-.13c.264-.081.564.015.688.262.123.247.024.55-.236.642A4 4 0 1 1 12 7a1.5 1.5 0 0 1-2.4 1.2A2 2 0 1 1 10 7a.5.5 0 0 0 1 0 3 3 0 1 0-3 3zm0-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2z" clip-rule="evenodd" />
|
|
246
246
|
</symbol>
|
|
247
|
+
<symbol viewBox="0 0 12 12" id="boost:12">
|
|
248
|
+
<path d="M10.5 2.1c-.1 0-.1 0-.1.1l-.6 7c-.5.2-.8.7-.8 1.3 0 .8.7 1.5 1.5 1.5s1.5-.7 1.5-1.5c0-.6-.3-1.1-.8-1.3l-.6-7c0-.1 0-.1-.1-.1zm0 8.9c-.3 0-.5-.2-.5-.5s.2-.5.5-.5.5.2.5.5-.2.5-.5.5z" />
|
|
249
|
+
<path d="M11.5 1c.3 0 .5-.2.5-.5s-.2-.5-.5-.5h-.1C8.1.2 5.1 1.7 3 4 1.3 6 .2 8.5 0 11.3v.2c0 .3.2.5.5.5s.5-.2.5-.5v-.2c.2-2.5 1.2-4.9 2.8-6.7C5.7 2.5 8.4 1.2 11.5 1z" />
|
|
250
|
+
</symbol>
|
|
251
|
+
<symbol viewBox="0 0 16 16" id="boost:16">
|
|
252
|
+
<path d="M15.5 1c.3 0 .5-.2.5-.5s-.2-.5-.5-.5C11.4.1 7.6 1.8 4.9 4.5 2 7.3.1 11.2 0 15.5c0 .3.2.5.5.5s.5-.2.5-.5c.1-4 1.9-7.7 4.6-10.3 2.6-2.5 6.1-4.1 9.9-4.2z" />
|
|
253
|
+
<path d="M14 2.8c-.1 0-.1 0-.2.1l-.8 9.3a2 2 0 0 0 .9 3.8 2 2 0 0 0 .9-3.8L14.2 3c-.1-.1-.1-.2-.2-.2zM14 15c-.6 0-1-.4-1-1s.4-1 1-1 1 .4 1 1-.4 1-1 1z" />
|
|
254
|
+
</symbol>
|
|
247
255
|
<symbol viewBox="0 0 12 12" id="boundary:12">
|
|
248
256
|
<path fill-rule="evenodd" d="M3 9V2.997a1 1 0 01.342-.753L5.835.062a.25.25 0 01.33 0l2.494 2.182A1.003 1.003 0 019 2.997V9h.666a1 1 0 01.6.2l1.332 1c.769.577.361 1.8-.6 1.8H1.002c-.961 0-1.369-1.223-.6-1.8l1.333-1a1 1 0 01.6-.2H3zm5-1.565V9H6.435L8 7.435zM5 9l3-3V3.435l-4 4V9h1zm2.469-6.469L6 1.247l-2 1.75V6L7.469 2.53zM1.002 11l1.333-1h7.33l1.333 1H1.002z" clip-rule="evenodd" />
|
|
249
257
|
</symbol>
|