@plesk/ui-library 3.35.2 → 3.35.3
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/Action/Action.js +1 -2
- package/cjs/components/Alert/Alert.js +1 -2
- package/cjs/components/AutoClosable/AutoClosable.js +1 -2
- package/cjs/components/AuxiliaryActions/AuxiliaryActions.js +1 -2
- package/cjs/components/Badge/Badge.js +1 -2
- package/cjs/components/Breadcrumbs/Breadcrumbs.js +1 -2
- package/cjs/components/Button/Button.js +1 -2
- package/cjs/components/Button/ButtonContext.js +2 -4
- package/cjs/components/ButtonGroup/ButtonGroup.js +1 -2
- package/cjs/components/Card/Card.js +1 -2
- package/cjs/components/Card/CardButton.js +1 -2
- package/cjs/components/Card/PreviewPanel.js +1 -2
- package/cjs/components/CardList/CardList.js +5 -10
- package/cjs/components/CardList/CardListToolbar.js +1 -2
- package/cjs/components/Carousel/Carousel.js +1 -2
- package/cjs/components/Checkbox/Checkbox.js +1 -2
- package/cjs/components/ClosingConfirmation/locale/en-US.js +2 -3
- package/cjs/components/ClosingConfirmation/useClosingConfirmation.js +1 -2
- package/cjs/components/CodeEditor/CodeEditor.js +1 -2
- package/cjs/components/Columns/Column.js +1 -2
- package/cjs/components/Columns/Columns.js +1 -2
- package/cjs/components/ComboBox/ComboBox.js +1 -2
- package/cjs/components/ComboBox/ComboBoxOption.js +1 -2
- package/cjs/components/ComboBoxDropdown/ComboBoxDropdown.js +1 -2
- package/cjs/components/ConsoleOutput/ConsoleOutput.js +1 -2
- package/cjs/components/ContentLoader/ContentLoader.js +1 -2
- package/cjs/components/ContentLoader/IconsLoader.js +1 -2
- package/cjs/components/Cuttable/Cuttable.js +1 -2
- package/cjs/components/Dialog/Dialog.js +1 -2
- package/cjs/components/DistractionFreeModeContext/DistractionFreeModeContext.js +1 -2
- package/cjs/components/Drawer/Drawer.js +1 -2
- package/cjs/components/Drawer/DrawerProgress.js +1 -2
- package/cjs/components/Drawer/Header.js +1 -2
- package/cjs/components/Dropdown/Dropdown.js +1 -2
- package/cjs/components/Dropdown/locale/en-US.js +2 -3
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessage.js +1 -2
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessageActions.js +1 -2
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessageDescription.js +1 -2
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessageSeparator.js +1 -2
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessageTitle.js +1 -2
- package/cjs/components/Figure/Figure.js +1 -2
- package/cjs/components/FocusTrap/FocusTrap.js +1 -2
- package/cjs/components/Form/DisabledContext.js +1 -2
- package/cjs/components/Form/Form.js +1 -2
- package/cjs/components/Form/FormContext.js +1 -2
- package/cjs/components/Form/ScrollableElementFormContext.js +1 -2
- package/cjs/components/FormField/FormField.js +4 -4
- package/cjs/components/FormField/index.js +9 -2
- package/cjs/components/FormFieldCheckbox/FormFieldCheckbox.js +1 -2
- package/cjs/components/FormFieldPassword/FormFieldPassword.js +1 -2
- package/cjs/components/FormFieldPassword/PasswordMeter.js +2 -3
- package/cjs/components/FormFieldPassword/estimatePassword.js +3 -5
- package/cjs/components/FormFieldPassword/generatePassword.js +1 -2
- package/cjs/components/FormFieldPassword/locale/en-US.js +2 -3
- package/cjs/components/FormFieldRadioButtons/FormFieldRadioButtons.js +65 -134
- package/cjs/components/FormFieldSelect/FormFieldSelect.js +1 -2
- package/cjs/components/FormFieldText/FormFieldText.js +56 -143
- package/cjs/components/Grid/Grid.js +1 -2
- package/cjs/components/GridCol/GridCol.js +1 -2
- package/cjs/components/Heading/Heading.js +1 -2
- package/cjs/components/Hint/Hint.js +1 -2
- package/cjs/components/Icon/Icon.js +10 -20
- package/cjs/components/Icon/constants.js +2 -4
- package/cjs/components/Icon/images/symbols.svg +39 -1
- package/cjs/components/Icon/oldIconNames.js +1 -2
- package/cjs/components/InPlaceEdit/InPlaceEdit.js +7 -29
- package/cjs/components/InPlaceEdit/locale/en-US.js +2 -3
- package/cjs/components/Input/Input.js +1 -2
- package/cjs/components/InputFile/InputFile.js +1 -2
- package/cjs/components/InputFile/locale/en-US.js +2 -3
- package/cjs/components/InputNumber/InputNumber.js +1 -2
- package/cjs/components/Item/Item.js +1 -2
- package/cjs/components/ItemLink/ItemLink.js +1 -2
- package/cjs/components/ItemList/ItemList.js +1 -2
- package/cjs/components/Label/Label.js +1 -2
- package/cjs/components/Layer/Layer.js +2 -4
- package/cjs/components/Layout/Layout.js +32 -123
- package/cjs/components/Link/Link.js +1 -2
- package/cjs/components/List/List.js +2 -2
- package/cjs/components/List/ListAction.js +1 -2
- package/cjs/components/List/ListActions.js +1 -2
- package/cjs/components/List/ListActionsDivider.js +1 -2
- package/cjs/components/List/ListEmptyView.js +1 -2
- package/cjs/components/List/ListOperation.js +2 -3
- package/cjs/components/List/ListOperationContext.js +1 -2
- package/cjs/components/LocaleProvider/LocaleProvider.js +1 -2
- package/cjs/components/Markdown/Markdown.js +1 -2
- package/cjs/components/Media/Media.js +5 -76
- package/cjs/components/Media/MediaSection.js +4 -26
- package/cjs/components/Menu/Menu.js +6 -58
- package/cjs/components/Menu/MenuBaseItem.js +5 -45
- package/cjs/components/Menu/MenuDivider.js +4 -20
- package/cjs/components/Menu/MenuHeader.js +4 -26
- package/cjs/components/Menu/MenuItem.js +7 -65
- package/cjs/components/Menu/MenuSelectableItem.js +5 -33
- package/cjs/components/OnDarkContext/OnDarkContext.js +1 -2
- package/cjs/components/Overlay/Overlay.js +1 -2
- package/cjs/components/PageHeader/PageHeader.js +1 -2
- package/cjs/components/Pagination/Pagination.js +2 -4
- package/cjs/components/Panel/Panel.js +1 -2
- package/cjs/components/Paragraph/Paragraph.js +1 -2
- package/cjs/components/Plaintext/Plaintext.js +3 -25
- package/cjs/components/Popover/Popover.js +22 -118
- package/cjs/components/Popper/Popper.js +1 -2
- package/cjs/components/Progress/Progress.js +1 -2
- package/cjs/components/ProgressBar/ProgressBar.js +1 -2
- package/cjs/components/ProgressBar/ProgressIndicator.js +1 -2
- package/cjs/components/ProgressDialog/ProgressDialog.js +1 -2
- package/cjs/components/ProgressDialogStep/ProgressDialogStep.js +1 -2
- package/cjs/components/ProgressStep/ProgressStep.js +7 -14
- package/cjs/components/Radio/Radio.js +1 -2
- package/cjs/components/Rating/Rating.js +1 -2
- package/cjs/components/ResponsiveContext/ResponsiveContext.js +1 -2
- package/cjs/components/Section/Section.js +30 -100
- package/cjs/components/Section/SectionItem.js +7 -46
- package/cjs/components/Section/index.js +16 -3
- package/cjs/components/SegmentedControl/SegmentedControl.js +1 -2
- package/cjs/components/Select/MultiValue.js +1 -2
- package/cjs/components/Select/Select.js +1 -2
- package/cjs/components/Select/SelectControl.js +1 -2
- package/cjs/components/Select/SelectOption.js +1 -2
- package/cjs/components/Select/SelectOptionGroup.js +1 -2
- package/cjs/components/Skeleton/Skeleton.js +1 -2
- package/cjs/components/Skeleton/SkeletonTabs.js +1 -2
- package/cjs/components/Skeleton/SkeletonText.js +1 -2
- package/cjs/components/Spinner/Spinner.js +1 -2
- package/cjs/components/SplitButton/SplitButton.js +1 -2
- package/cjs/components/Spot/Spot.js +1 -2
- package/cjs/components/Spot/SpotPopup.js +1 -2
- package/cjs/components/Spot/SpotPulsar.js +1 -2
- package/cjs/components/Squeezer/Squeezer.js +1 -2
- package/cjs/components/Status/Status.js +1 -2
- package/cjs/components/StatusMessage/StatusMessage.js +1 -2
- package/cjs/components/Subnav/Subnav.js +11 -58
- package/cjs/components/Subnav/index.js +6 -12
- package/cjs/components/Switch/Switch.js +1 -2
- package/cjs/components/SwitchesPanel/SwitchesPanel.js +1 -2
- package/cjs/components/SwitchesPanelItem/SwitchesPanelItem.js +1 -2
- package/cjs/components/Tabs/SearchBar.js +1 -2
- package/cjs/components/Tabs/Tab.js +1 -2
- package/cjs/components/Tabs/Tabs.js +1 -2
- package/cjs/components/Text/Text.js +1 -2
- package/cjs/components/TextArea/TextArea.js +1 -2
- package/cjs/components/Toolbar/RegistryContext.js +1 -2
- package/cjs/components/Toolbar/Toolbar.js +6 -21
- package/cjs/components/Toolbar/ToolbarExpander.js +1 -2
- package/cjs/components/Toolbar/ToolbarGroup.js +21 -53
- package/cjs/components/Toolbar/ToolbarMenu.js +2 -3
- package/cjs/components/Tooltip/Tooltip.js +1 -2
- package/cjs/components/Tour/Tour.js +1 -2
- package/cjs/components/Translate/Translate.js +1 -2
- package/cjs/components/VerticalContext/VerticalContext.js +2 -4
- package/cjs/components/index.js +63 -55
- package/cjs/components/intentIconMap.js +2 -3
- package/cjs/index.js +1 -2
- package/cjs/publicPath.js +1 -2
- package/cjs/utils/types/DataAttributes.js +5 -0
- package/dist/images/symbols.svg +39 -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 +759 -1786
- 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/FormField/FormField.js +4 -2
- package/esm/components/FormField/index.js +2 -1
- package/esm/components/FormFieldPassword/PasswordMeter.js +1 -1
- package/esm/components/FormFieldRadioButtons/FormFieldRadioButtons.js +64 -132
- package/esm/components/FormFieldText/FormFieldText.js +55 -140
- package/esm/components/Icon/constants.js +2 -2
- package/esm/components/Icon/images/symbols.svg +39 -1
- package/esm/components/InPlaceEdit/InPlaceEdit.js +6 -25
- package/esm/components/Layout/Layout.js +32 -121
- package/esm/components/List/List.js +1 -0
- package/esm/components/List/ListOperation.js +1 -1
- package/esm/components/Media/Media.js +4 -74
- package/esm/components/Media/MediaSection.js +2 -25
- package/esm/components/Menu/Menu.js +5 -54
- package/esm/components/Menu/MenuBaseItem.js +4 -45
- package/esm/components/Menu/MenuDivider.js +2 -19
- package/esm/components/Menu/MenuHeader.js +2 -25
- package/esm/components/Menu/MenuItem.js +5 -62
- package/esm/components/Menu/MenuSelectableItem.js +3 -32
- package/esm/components/Plaintext/Plaintext.js +2 -23
- package/esm/components/Popover/Popover.js +21 -114
- package/esm/components/Section/Section.js +28 -97
- package/esm/components/Section/SectionItem.js +5 -41
- package/esm/components/Section/index.js +2 -1
- package/esm/components/Subnav/Subnav.js +10 -54
- package/esm/components/Subnav/index.js +1 -2
- package/esm/components/Toolbar/Toolbar.js +7 -21
- package/esm/components/Toolbar/ToolbarGroup.js +17 -50
- package/esm/components/Toolbar/ToolbarMenu.js +1 -1
- package/esm/components/index.js +5 -10
- package/esm/index.js +1 -1
- package/esm/utils/types/DataAttributes.js +1 -0
- package/package.json +21 -21
- package/styleguide/build/bundle.8058bbce.js +2 -0
- package/styleguide/images/symbols.svg +39 -1
- package/styleguide/index.html +2 -2
- package/types/src/components/AutoClosable/AutoClosable.d.ts +23 -2
- package/types/src/components/Button/Button.d.ts +1 -4
- package/types/src/components/Columns/Column.d.ts +2 -2
- package/types/src/components/Columns/Columns.d.ts +2 -2
- package/types/src/components/Columns/index.d.ts +2 -0
- package/types/src/components/DistractionFreeModeContext/DistractionFreeModeContext.d.ts +1 -1
- package/types/src/components/DistractionFreeModeContext/index.d.ts +1 -0
- package/types/src/components/FormFieldPassword/PasswordMeter.d.ts +4 -3
- package/types/src/components/FormFieldRadioButtons/FormFieldRadioButtons.d.ts +72 -0
- package/types/src/components/FormFieldRadioButtons/index.d.ts +2 -0
- package/types/src/components/FormFieldSelect/FormFieldSelect.d.ts +1 -1
- package/types/src/components/FormFieldSelect/index.d.ts +1 -0
- package/types/src/components/FormFieldText/FormFieldText.d.ts +82 -0
- package/types/src/components/FormFieldText/index.d.ts +2 -0
- package/types/src/components/Icon/constants.d.ts +1 -1
- package/types/src/components/InPlaceEdit/InPlaceEdit.d.ts +50 -0
- package/types/src/components/InPlaceEdit/index.d.ts +2 -0
- package/types/src/components/Input/Input.d.ts +1 -1
- package/types/src/components/Input/index.d.ts +1 -0
- package/types/src/components/InputFile/InputFile.d.ts +3 -2
- package/types/src/components/InputFile/index.d.ts +1 -0
- package/types/src/components/InputNumber/InputNumber.d.ts +2 -2
- package/types/src/components/InputNumber/index.d.ts +1 -0
- package/types/src/components/Layout/Layout.d.ts +161 -0
- package/types/src/components/Layout/index.d.ts +2 -0
- package/types/src/components/Media/Media.d.ts +66 -0
- package/types/src/components/Media/MediaSection.d.ts +22 -0
- package/types/src/components/Media/index.d.ts +4 -0
- package/types/src/components/Menu/Menu.d.ts +40 -0
- package/types/src/components/Menu/MenuBaseItem.d.ts +41 -0
- package/types/src/components/Menu/MenuDivider.d.ts +16 -0
- package/types/src/components/Menu/MenuHeader.d.ts +22 -0
- package/types/src/components/Menu/MenuItem.d.ts +49 -0
- package/types/src/components/Menu/MenuSelectableItem.d.ts +28 -0
- package/types/src/components/Menu/index.d.ts +11 -0
- package/types/src/components/Panel/Panel.d.ts +2 -1
- package/types/src/components/Plaintext/Plaintext.d.ts +23 -0
- package/types/src/components/Plaintext/index.d.ts +2 -0
- package/types/src/components/Popover/Popover.d.ts +156 -0
- package/types/src/components/Popover/index.d.ts +2 -0
- package/types/src/components/Section/Section.d.ts +145 -0
- package/types/src/components/Section/SectionItem.d.ts +38 -0
- package/types/src/components/Section/index.d.ts +5 -0
- package/types/src/components/Spot/Spot.d.ts +3 -2
- package/types/src/components/Spot/SpotPulsar.d.ts +4 -2
- package/types/src/components/Spot/index.d.ts +1 -0
- package/types/src/components/Subnav/Subnav.d.ts +50 -0
- package/types/src/components/Subnav/index.d.ts +2 -0
- package/types/src/components/TextArea/TextArea.d.ts +3 -3
- package/types/src/components/TextArea/index.d.ts +1 -0
- package/types/src/components/Toolbar/RegistryContext.d.ts +2 -2
- package/types/src/components/Toolbar/Toolbar.d.ts +47 -0
- package/types/src/components/Toolbar/ToolbarGroup.d.ts +46 -0
- package/types/src/components/Toolbar/ToolbarMenu.d.ts +1 -1
- package/types/src/components/Toolbar/index.d.ts +5 -0
- package/types/src/components/Tour/Tour.d.ts +1 -1
- package/types/src/components/index.d.ts +21 -10
- package/types/src/utils/types/DataAttributes.d.ts +3 -0
- package/types/src/utils/types/index.d.ts +1 -0
- package/cjs/tests/index.js +0 -13
- package/cjs/tests/renderer.js +0 -33
- package/esm/tests/index.js +0 -3
- package/esm/tests/renderer.js +0 -25
- package/styleguide/build/bundle.6318f4a5.js +0 -2
- /package/styleguide/build/{bundle.6318f4a5.js.LICENSE.txt → bundle.8058bbce.js.LICENSE.txt} +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
2
2
|
|
|
3
|
-
import React, { cloneElement, Children, isValidElement, useRef, useMemo } from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
3
|
import classNames from 'classnames';
|
|
6
4
|
import { CLS_PREFIX } from '../../constants';
|
|
7
5
|
import { safeInvoke, createFocusManager } from '../utils';
|
|
6
|
+
import { cloneElement, Children, isValidElement, useRef, useMemo } from 'react';
|
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
8
|
/**
|
|
10
9
|
* `Subnav` component is used when you need a second level navigation under [Tabs](#!/Tabs) on the screen.
|
|
@@ -12,13 +11,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
12
11
|
*/
|
|
13
12
|
const Subnav = _ref => {
|
|
14
13
|
let {
|
|
15
|
-
baseClassName,
|
|
16
14
|
className,
|
|
17
15
|
children,
|
|
18
16
|
onKeyDown,
|
|
17
|
+
baseClassName = `${CLS_PREFIX}subnav`,
|
|
19
18
|
...props
|
|
20
19
|
} = _ref;
|
|
21
|
-
const rootRef = useRef();
|
|
20
|
+
const rootRef = useRef(null);
|
|
22
21
|
const {
|
|
23
22
|
focusNext,
|
|
24
23
|
focusPrev,
|
|
@@ -47,7 +46,9 @@ const Subnav = _ref => {
|
|
|
47
46
|
break;
|
|
48
47
|
case 'Enter':
|
|
49
48
|
e.preventDefault();
|
|
50
|
-
e.target
|
|
49
|
+
if (e.target instanceof HTMLElement) {
|
|
50
|
+
e.target.click();
|
|
51
|
+
}
|
|
51
52
|
break;
|
|
52
53
|
}
|
|
53
54
|
safeInvoke(onKeyDown, e);
|
|
@@ -67,6 +68,9 @@ const Subnav = _ref => {
|
|
|
67
68
|
});
|
|
68
69
|
const items = Children.map(children, (child, index) => {
|
|
69
70
|
if (itemIndex === index) {
|
|
71
|
+
if (! /*#__PURE__*/isValidElement(child)) {
|
|
72
|
+
return child;
|
|
73
|
+
}
|
|
70
74
|
return /*#__PURE__*/cloneElement(child, {
|
|
71
75
|
tabIndex: 0
|
|
72
76
|
});
|
|
@@ -81,41 +85,15 @@ const Subnav = _ref => {
|
|
|
81
85
|
children: items
|
|
82
86
|
});
|
|
83
87
|
};
|
|
84
|
-
Subnav.propTypes = {
|
|
85
|
-
/**
|
|
86
|
-
* Subnav items
|
|
87
|
-
* @since 0.0.42
|
|
88
|
-
*/
|
|
89
|
-
children: PropTypes.node,
|
|
90
|
-
/**
|
|
91
|
-
* @ignore
|
|
92
|
-
*/
|
|
93
|
-
className: PropTypes.string,
|
|
94
|
-
/**
|
|
95
|
-
* @ignore
|
|
96
|
-
*/
|
|
97
|
-
baseClassName: PropTypes.string,
|
|
98
|
-
/**
|
|
99
|
-
* @ignore
|
|
100
|
-
*/
|
|
101
|
-
onKeyDown: PropTypes.string
|
|
102
|
-
};
|
|
103
|
-
Subnav.defaultProps = {
|
|
104
|
-
children: null,
|
|
105
|
-
className: null,
|
|
106
|
-
baseClassName: `${CLS_PREFIX}subnav`,
|
|
107
|
-
onKeyDown: undefined
|
|
108
|
-
};
|
|
109
|
-
|
|
110
88
|
/**
|
|
111
89
|
* SubnavItem component.
|
|
112
90
|
*/
|
|
113
91
|
const SubnavItem = _ref2 => {
|
|
114
92
|
let {
|
|
115
|
-
baseClassName,
|
|
116
93
|
className,
|
|
117
94
|
active,
|
|
118
95
|
children,
|
|
96
|
+
baseClassName = `${CLS_PREFIX}subnav__item`,
|
|
119
97
|
...props
|
|
120
98
|
} = _ref2;
|
|
121
99
|
return /*#__PURE__*/cloneElement(children, {
|
|
@@ -124,27 +102,5 @@ const SubnavItem = _ref2 => {
|
|
|
124
102
|
...props
|
|
125
103
|
});
|
|
126
104
|
};
|
|
127
|
-
SubnavItem.propTypes = {
|
|
128
|
-
/**
|
|
129
|
-
* Is item active.
|
|
130
|
-
*/
|
|
131
|
-
active: PropTypes.bool,
|
|
132
|
-
/**
|
|
133
|
-
* Content of the item
|
|
134
|
-
*/
|
|
135
|
-
children: PropTypes.element.isRequired,
|
|
136
|
-
/**
|
|
137
|
-
* @ignore
|
|
138
|
-
*/
|
|
139
|
-
className: PropTypes.string,
|
|
140
|
-
/**
|
|
141
|
-
* @ignore
|
|
142
|
-
*/
|
|
143
|
-
baseClassName: PropTypes.string
|
|
144
|
-
};
|
|
145
|
-
SubnavItem.defaultProps = {
|
|
146
|
-
className: null,
|
|
147
|
-
baseClassName: `${CLS_PREFIX}subnav__item`
|
|
148
|
-
};
|
|
149
105
|
export default Subnav;
|
|
150
106
|
export { SubnavItem };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
4
|
+
import { Component } from 'react';
|
|
6
5
|
import classNames from 'classnames';
|
|
7
6
|
import { CLS_PREFIX } from '../../constants';
|
|
8
7
|
import RegistryContext, { createRegistry } from './RegistryContext';
|
|
9
8
|
import DistractionFreeModeContext from '../DistractionFreeModeContext';
|
|
10
9
|
import { toToolbarItems } from './ToolbarItem';
|
|
11
10
|
import Squeezer from '../Squeezer';
|
|
12
|
-
|
|
11
|
+
|
|
13
12
|
/**
|
|
14
13
|
* `Toolbar` component is a panel containing various instruments used for managing the contents of a large content block.
|
|
15
14
|
* Toolbar is located on top of the managed content block.
|
|
@@ -17,7 +16,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
17
16
|
* and controls for changing the way the content block looks.
|
|
18
17
|
* @since 0.0.57
|
|
19
18
|
*/
|
|
20
|
-
|
|
19
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
20
|
class Toolbar extends Component {
|
|
22
21
|
constructor(props) {
|
|
23
22
|
super(props);
|
|
@@ -36,6 +35,8 @@ class Toolbar extends Component {
|
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
});
|
|
38
|
+
_defineProperty(this, "registry", void 0);
|
|
39
|
+
_defineProperty(this, "measure", void 0);
|
|
39
40
|
this.registry = createRegistry();
|
|
40
41
|
this.measure = () => {};
|
|
41
42
|
}
|
|
@@ -73,24 +74,9 @@ class Toolbar extends Component {
|
|
|
73
74
|
});
|
|
74
75
|
}
|
|
75
76
|
}
|
|
76
|
-
Toolbar
|
|
77
|
-
/**
|
|
78
|
-
* Content of the `Toolbar`.
|
|
79
|
-
* @since 0.0.57
|
|
80
|
-
*/
|
|
81
|
-
children: PropTypes.node,
|
|
82
|
-
/**
|
|
83
|
-
* @ignore
|
|
84
|
-
*/
|
|
85
|
-
className: PropTypes.string,
|
|
86
|
-
/**
|
|
87
|
-
* @ignore
|
|
88
|
-
*/
|
|
89
|
-
baseClassName: PropTypes.string
|
|
90
|
-
};
|
|
91
|
-
Toolbar.defaultProps = {
|
|
77
|
+
_defineProperty(Toolbar, "defaultProps", {
|
|
92
78
|
children: null,
|
|
93
79
|
className: null,
|
|
94
80
|
baseClassName: `${CLS_PREFIX}toolbar`
|
|
95
|
-
};
|
|
81
|
+
});
|
|
96
82
|
export default Toolbar;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.
|
|
3
3
|
|
|
4
|
-
import
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
4
|
+
import { Component, Children, useContext, isValidElement } from 'react';
|
|
6
5
|
import classNames from 'classnames';
|
|
7
6
|
import { CLS_PREFIX } from '../../constants';
|
|
8
7
|
import Dropdown from '../Dropdown';
|
|
@@ -23,6 +22,7 @@ class ToolbarGroup extends Component {
|
|
|
23
22
|
super(props);
|
|
24
23
|
_defineProperty(this, "state", {
|
|
25
24
|
compact: false,
|
|
25
|
+
availableInDistractionFreeMode: false,
|
|
26
26
|
distractionFreeMode: {
|
|
27
27
|
enabled: false,
|
|
28
28
|
toggle: () => {
|
|
@@ -35,6 +35,9 @@ class ToolbarGroup extends Component {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
+
_defineProperty(this, "registry", void 0);
|
|
39
|
+
_defineProperty(this, "selfApi", void 0);
|
|
40
|
+
_defineProperty(this, "childrenApi", void 0);
|
|
38
41
|
this.registry = createRegistry();
|
|
39
42
|
this.selfApi = {
|
|
40
43
|
isCompact: () => this.state.compact,
|
|
@@ -103,11 +106,12 @@ class ToolbarGroup extends Component {
|
|
|
103
106
|
distractionFreeMode,
|
|
104
107
|
availableInDistractionFreeMode
|
|
105
108
|
} = this.state;
|
|
106
|
-
let hasExpander = Children.toArray(children).some(child => child && child.type === ToolbarExpander);
|
|
109
|
+
let hasExpander = Children.toArray(children).some(child => /*#__PURE__*/isValidElement(child) && child.type === ToolbarExpander);
|
|
107
110
|
if (groupable && compact && Children.count(children) > 1) {
|
|
108
111
|
hasExpander = false;
|
|
109
112
|
children = /*#__PURE__*/_jsx(Dropdown, {
|
|
110
113
|
menu: /*#__PURE__*/_jsx(ToolbarMenu, {
|
|
114
|
+
onItemClick: () => {},
|
|
111
115
|
children: children
|
|
112
116
|
}),
|
|
113
117
|
children: title
|
|
@@ -133,62 +137,25 @@ class ToolbarGroup extends Component {
|
|
|
133
137
|
});
|
|
134
138
|
}
|
|
135
139
|
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Title.
|
|
139
|
-
* @since 0.0.60
|
|
140
|
-
*/
|
|
141
|
-
title: PropTypes.node.isRequired,
|
|
142
|
-
/**
|
|
143
|
-
* Whether to group children into a dropdown or not.
|
|
144
|
-
* @since 3.8.0
|
|
145
|
-
*/
|
|
146
|
-
groupable: PropTypes.bool,
|
|
147
|
-
/**
|
|
148
|
-
* Content of the `ToolbarGroup`.
|
|
149
|
-
* @since 0.0.57
|
|
150
|
-
*/
|
|
151
|
-
children: PropTypes.node,
|
|
152
|
-
/**
|
|
153
|
-
* @ignore
|
|
154
|
-
*/
|
|
155
|
-
className: PropTypes.string,
|
|
156
|
-
/**
|
|
157
|
-
* @ignore
|
|
158
|
-
*/
|
|
159
|
-
baseClassName: PropTypes.string
|
|
160
|
-
};
|
|
161
|
-
const defaultProps = {
|
|
162
|
-
children: undefined,
|
|
163
|
-
className: undefined,
|
|
164
|
-
baseClassName: `${CLS_PREFIX}toolbar__group`,
|
|
165
|
-
groupable: true
|
|
166
|
-
};
|
|
167
|
-
ToolbarGroup.propTypes = {
|
|
168
|
-
...propTypes,
|
|
169
|
-
registry: PropTypes.shape({
|
|
170
|
-
register: PropTypes.func.isRequired,
|
|
171
|
-
unregister: PropTypes.func.isRequired
|
|
172
|
-
}),
|
|
173
|
-
distractionFreeMode: PropTypes.shape({
|
|
174
|
-
enabled: PropTypes.bool.isRequired,
|
|
175
|
-
toggle: PropTypes.func.isRequired
|
|
176
|
-
})
|
|
177
|
-
};
|
|
178
|
-
ToolbarGroup.defaultProps = {
|
|
140
|
+
_defineProperty(ToolbarGroup, "defaultProps", {
|
|
179
141
|
registry: undefined,
|
|
180
142
|
distractionFreeMode: undefined
|
|
181
|
-
};
|
|
182
|
-
const ToolbarGroupWrapper =
|
|
143
|
+
});
|
|
144
|
+
const ToolbarGroupWrapper = _ref => {
|
|
145
|
+
let {
|
|
146
|
+
groupable = true,
|
|
147
|
+
baseClassName = `${CLS_PREFIX}toolbar__group`,
|
|
148
|
+
...props
|
|
149
|
+
} = _ref;
|
|
183
150
|
const registry = useContext(RegistryContext);
|
|
184
151
|
const distractionFreeMode = useContext(DistractionFreeModeContext);
|
|
185
152
|
return /*#__PURE__*/_jsx(ToolbarGroup, {
|
|
153
|
+
groupable: groupable,
|
|
154
|
+
baseClassName: baseClassName,
|
|
186
155
|
...props,
|
|
187
156
|
registry: registry,
|
|
188
157
|
distractionFreeMode: distractionFreeMode
|
|
189
158
|
});
|
|
190
159
|
};
|
|
191
160
|
ToolbarGroupWrapper.displayName = 'ToolbarGroup';
|
|
192
|
-
ToolbarGroupWrapper.propTypes = propTypes;
|
|
193
|
-
ToolbarGroupWrapper.defaultProps = defaultProps;
|
|
194
161
|
export default ToolbarGroupWrapper;
|
package/esm/components/index.js
CHANGED
|
@@ -15,8 +15,7 @@ export { default as Carousel } from './Carousel';
|
|
|
15
15
|
export { default as Checkbox } from './Checkbox';
|
|
16
16
|
export { default as Radio } from './Radio';
|
|
17
17
|
export { default as CodeEditor } from './CodeEditor';
|
|
18
|
-
export { default as Columns } from './Columns';
|
|
19
|
-
export * from './Columns';
|
|
18
|
+
export { default as Columns, Column } from './Columns';
|
|
20
19
|
export { default as ComboBox } from './ComboBox';
|
|
21
20
|
export * from './ComboBox';
|
|
22
21
|
export { default as ConsoleOutput } from './ConsoleOutput';
|
|
@@ -59,10 +58,8 @@ export * from './List';
|
|
|
59
58
|
export { default as LocaleProvider } from './LocaleProvider';
|
|
60
59
|
export * from './LocaleProvider';
|
|
61
60
|
export { default as Markdown } from './Markdown';
|
|
62
|
-
export { default as Media } from './Media';
|
|
63
|
-
export
|
|
64
|
-
export { default as Menu } from './Menu';
|
|
65
|
-
export * from './Menu';
|
|
61
|
+
export { default as Media, MediaSection } from './Media';
|
|
62
|
+
export { default as Menu, MenuDivider, MenuHeader, MenuItem, MenuSelectableItem } from './Menu';
|
|
66
63
|
export { default as Overlay } from './Overlay';
|
|
67
64
|
export { default as PageHeader } from './PageHeader';
|
|
68
65
|
export { default as Pagination } from './Pagination';
|
|
@@ -83,8 +80,7 @@ export { default as Spot } from './Spot';
|
|
|
83
80
|
export { default as SplitButton } from './SplitButton';
|
|
84
81
|
export { default as Status } from './Status';
|
|
85
82
|
export { default as StatusMessage } from './StatusMessage';
|
|
86
|
-
export { default as Subnav } from './Subnav';
|
|
87
|
-
export * from './Subnav';
|
|
83
|
+
export { default as Subnav, SubnavItem } from './Subnav';
|
|
88
84
|
export { default as Switch } from './Switch';
|
|
89
85
|
export { default as SwitchesPanel } from './SwitchesPanel';
|
|
90
86
|
export { default as SwitchesPanelItem } from './SwitchesPanelItem';
|
|
@@ -92,8 +88,7 @@ export { default as Tabs } from './Tabs';
|
|
|
92
88
|
export * from './Tabs';
|
|
93
89
|
export { default as Text } from './Text';
|
|
94
90
|
export { default as Toaster } from './Toaster';
|
|
95
|
-
export { default as Toolbar } from './Toolbar';
|
|
96
|
-
export * from './Toolbar';
|
|
91
|
+
export { default as Toolbar, ToolbarGroup, ToolbarExpander } from './Toolbar';
|
|
97
92
|
export { default as Tooltip } from './Tooltip';
|
|
98
93
|
export { default as Tour } from './Tour';
|
|
99
94
|
export { default as Translate } from './Translate';
|
package/esm/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plesk/ui-library",
|
|
3
|
-
"version": "3.35.
|
|
3
|
+
"version": "3.35.3",
|
|
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.
|
|
45
|
+
"@babel/runtime": "^7.23.1",
|
|
46
46
|
"@plesk/react-movable": "^2.7.1",
|
|
47
47
|
"classnames": "^2.3.2",
|
|
48
48
|
"codemirror": "5.58.2",
|
|
@@ -58,30 +58,30 @@
|
|
|
58
58
|
"use-focus-visible": "^1.0.2"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@babel/core": "^7.
|
|
61
|
+
"@babel/core": "^7.23.0",
|
|
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.
|
|
65
|
-
"@babel/preset-env": "^7.22.
|
|
66
|
-
"@babel/preset-react": "^7.22.
|
|
67
|
-
"@babel/preset-typescript": "^7.
|
|
68
|
-
"@babel/types": "^7.
|
|
64
|
+
"@babel/plugin-transform-runtime": "^7.22.15",
|
|
65
|
+
"@babel/preset-env": "^7.22.20",
|
|
66
|
+
"@babel/preset-react": "^7.22.15",
|
|
67
|
+
"@babel/preset-typescript": "^7.23.0",
|
|
68
|
+
"@babel/types": "^7.23.0",
|
|
69
69
|
"@csstools/postcss-logical-float-and-clear": "^1.0.1",
|
|
70
70
|
"@plesk/eslint-config": "^3.0.0",
|
|
71
71
|
"@plesk/stylelint-config": "^2.0.0",
|
|
72
|
-
"@testing-library/dom": "^9.3.
|
|
72
|
+
"@testing-library/dom": "^9.3.3",
|
|
73
73
|
"@testing-library/jest-dom": "^5.17.0",
|
|
74
74
|
"@testing-library/react": "^12.1.5",
|
|
75
75
|
"@testing-library/user-event": "^12.8.3",
|
|
76
|
-
"@types/buble": "^0.20.
|
|
76
|
+
"@types/buble": "^0.20.2",
|
|
77
77
|
"@types/classnames": "2.3.1",
|
|
78
78
|
"@types/doctrine": "^0.0.5",
|
|
79
|
-
"@types/enzyme": "^3.10.
|
|
80
|
-
"@types/jest": "^
|
|
81
|
-
"@types/jest-image-snapshot": "^6.2.
|
|
79
|
+
"@types/enzyme": "^3.10.14",
|
|
80
|
+
"@types/jest": "^27.5.2",
|
|
81
|
+
"@types/jest-image-snapshot": "^6.2.1",
|
|
82
82
|
"@types/marked": "^4.3.1",
|
|
83
|
-
"@types/node": "^16.18.
|
|
84
|
-
"@types/react": "^17.0.
|
|
83
|
+
"@types/node": "^16.18.54",
|
|
84
|
+
"@types/react": "^17.0.65",
|
|
85
85
|
"@types/react-dom": "^17.0.20",
|
|
86
86
|
"@types/react-measure": "2.0.8",
|
|
87
87
|
"@types/react-transition-group": "^4.4.6",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
90
90
|
"@typescript-eslint/parser": "^5.62.0",
|
|
91
91
|
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
|
|
92
|
-
"autoprefixer": "^10.4.
|
|
92
|
+
"autoprefixer": "^10.4.16",
|
|
93
93
|
"babel-loader": "^8.3.0",
|
|
94
94
|
"babel-plugin-transform-require-ignore": "^0.1.1",
|
|
95
95
|
"clean-webpack-plugin": "^4.0.0",
|
|
@@ -98,19 +98,19 @@
|
|
|
98
98
|
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
99
99
|
"enzyme": "^3.11.0",
|
|
100
100
|
"enzyme-to-json": "^3.6.2",
|
|
101
|
-
"eslint": "^8.
|
|
101
|
+
"eslint": "^8.50.0",
|
|
102
102
|
"eslint-config-prettier": "^8.10.0",
|
|
103
103
|
"eslint-plugin-markdown": "^3.0.1",
|
|
104
104
|
"eslint-plugin-prettier": "^4.2.1",
|
|
105
105
|
"html-webpack-plugin": "^5.5.3",
|
|
106
106
|
"inquirer": "^3.3.0",
|
|
107
|
-
"jest": "^
|
|
107
|
+
"jest": "^27.5.1",
|
|
108
108
|
"jest-dev-server": "^9.0.0",
|
|
109
109
|
"jest-image-snapshot": "^6.2.0",
|
|
110
110
|
"less": "^4.2.0",
|
|
111
111
|
"less-loader": "^11.1.3",
|
|
112
112
|
"mini-css-extract-plugin": "^2.7.6",
|
|
113
|
-
"postcss": "^8.4.
|
|
113
|
+
"postcss": "^8.4.30",
|
|
114
114
|
"postcss-less": "^6.0.0",
|
|
115
115
|
"postcss-loader": "^7.3.3",
|
|
116
116
|
"postcss-logical": "^6.2.0",
|
|
@@ -121,9 +121,9 @@
|
|
|
121
121
|
"react-dom": "^17.0.2",
|
|
122
122
|
"react-styleguidist": "^12.0.1",
|
|
123
123
|
"rimraf": "^5.0.1",
|
|
124
|
-
"rtlcss": "^4.1.
|
|
124
|
+
"rtlcss": "^4.1.1",
|
|
125
125
|
"style-loader": "^3.3.3",
|
|
126
|
-
"stylelint": "^15.10.
|
|
126
|
+
"stylelint": "^15.10.3",
|
|
127
127
|
"stylelint-declaration-block-no-ignored-properties": "^2.7.0",
|
|
128
128
|
"stylelint-no-unsupported-browser-features": "^6.1.0",
|
|
129
129
|
"stylelint-prettier": "^3.0.0",
|