@plesk/ui-library 3.43.2 → 3.44.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/Action/Action.js +10 -3
- package/cjs/components/Alert/Alert.js +1 -0
- package/cjs/components/AutoClosable/AutoClosable.js +47 -61
- package/cjs/components/AuxiliaryActions/AuxiliaryActions.js +13 -4
- package/cjs/components/Button/Button.js +1 -0
- package/cjs/components/Card/Card.js +10 -15
- package/cjs/components/CardList/CardList.js +6 -9
- package/cjs/components/CardList/CardListToolbar.js +12 -18
- package/cjs/components/ClosingConfirmation/useClosingConfirmation.js +7 -11
- package/cjs/components/CodeEditor/CodeEditor.js +1 -2
- package/cjs/components/Columns/Columns.js +1 -2
- package/cjs/components/ComboBox/ComboBox.js +1 -2
- package/cjs/components/ComboBoxDropdown/ComboBoxDropdown.js +4 -2
- package/cjs/components/ComboBoxDropdown/index.js +1 -2
- package/cjs/components/Cuttable/Cuttable.js +6 -8
- package/cjs/components/Dialog/Dialog.js +17 -13
- package/cjs/components/Drawer/Drawer.js +14 -7
- package/cjs/components/Drawer/DrawerProgress.js +4 -6
- package/cjs/components/Dropdown/Dropdown.js +12 -9
- package/cjs/components/Dropdown/index.js +1 -2
- package/cjs/components/ExtendedStatusMessage/ExtendedStatusMessage.js +1 -0
- package/cjs/components/Figure/index.js +1 -2
- package/cjs/components/Form/Form.js +19 -20
- package/cjs/components/Form/index.js +1 -2
- package/cjs/components/FormField/FormField.js +77 -51
- package/cjs/components/FormField/index.js +1 -2
- package/cjs/components/FormFieldCheckbox/FormFieldCheckbox.js +6 -2
- package/cjs/components/FormFieldPassword/FormFieldPassword.js +18 -21
- package/cjs/components/FormFieldPassword/PasswordMeter.js +9 -15
- package/cjs/components/FormFieldPassword/estimatePassword.js +21 -33
- package/cjs/components/FormFieldRadioButtons/FormFieldRadioButtons.js +50 -44
- package/cjs/components/FormFieldSelect/FormFieldSelect.js +1 -1
- package/cjs/components/FormFieldText/FormFieldText.js +7 -1
- package/cjs/components/Heading/Heading.js +1 -2
- package/cjs/components/Hint/Hint.js +2 -1
- package/cjs/components/Icon/Icon.js +6 -0
- package/cjs/components/Icon/index.js +1 -2
- package/cjs/components/Icon/utils.js +17 -8
- package/cjs/components/InPlaceEdit/Editor.js +5 -8
- package/cjs/components/InPlaceEdit/InPlaceEdit.js +3 -5
- package/cjs/components/InputFile/InputFile.js +7 -9
- package/cjs/components/Item/Item.js +1 -2
- package/cjs/components/ItemList/ItemList.js +1 -2
- package/cjs/components/Layer/index.js +1 -2
- package/cjs/components/Layout/Layout.js +2 -2
- package/cjs/components/Link/Link.js +2 -0
- package/cjs/components/List/List.js +38 -45
- package/cjs/components/List/ListAction.js +1 -0
- package/cjs/components/List/ListActions.js +1 -0
- package/cjs/components/List/ListEmptyView.js +7 -10
- package/cjs/components/List/ListOperation.js +3 -12
- package/cjs/components/LocaleProvider/LocaleProvider.js +20 -12
- package/cjs/components/LocaleProvider/index.js +1 -2
- package/cjs/components/Media/Media.js +1 -2
- package/cjs/components/Menu/Menu.js +10 -8
- package/cjs/components/Menu/MenuBaseItem.js +1 -2
- package/cjs/components/Menu/MenuItem.js +2 -1
- package/cjs/components/Overlay/Overlay.js +2 -0
- package/cjs/components/Pagination/Pagination.js +6 -10
- package/cjs/components/Pagination/index.js +1 -2
- package/cjs/components/Popover/Popover.js +1 -1
- package/cjs/components/Popper/index.js +1 -2
- package/cjs/components/ProgressDialog/ProgressDialog.js +5 -7
- package/cjs/components/ProgressStep/ProgressStep.js +1 -2
- package/cjs/components/ProgressStep/index.js +1 -2
- package/cjs/components/Section/Section.js +87 -225
- package/cjs/components/{Dropdown/locale/en-US.js → Section/SectionContext.js} +4 -3
- package/cjs/components/Section/index.js +1 -2
- package/cjs/components/Section/useCollapsed.js +19 -0
- package/cjs/components/Section/useVertical.js +38 -0
- package/cjs/components/SegmentedControl/DropdownControl.js +1 -2
- package/cjs/components/SegmentedControl/SegmentedControl.js +1 -0
- package/cjs/components/SegmentedControl/index.js +1 -2
- package/cjs/components/Select/Select.js +10 -7
- package/cjs/components/Select/SelectControl.js +13 -3
- package/cjs/components/SplitButton/index.js +1 -2
- package/cjs/components/Spot/SpotPopup.js +3 -4
- package/cjs/components/Status/Status.js +1 -0
- package/cjs/components/Subnav/index.js +1 -2
- package/cjs/components/Tabs/SearchBar.js +1 -2
- package/cjs/components/Tabs/TabIcon.js +1 -2
- package/cjs/components/Tabs/TabList.js +30 -14
- package/cjs/components/Tabs/TabListItem.js +5 -1
- package/cjs/components/Tabs/Tabs.js +16 -12
- package/cjs/components/Tabs/useWidths.js +5 -5
- package/cjs/components/Toast/Toast.js +1 -0
- package/cjs/components/Toast/index.js +1 -2
- package/cjs/components/Toaster/GroupLabel.js +5 -3
- package/cjs/components/Toolbar/Toolbar.js +1 -2
- package/cjs/components/Toolbar/ToolbarGroup.js +1 -2
- package/cjs/components/Toolbar/ToolbarMenu.js +1 -2
- package/cjs/components/Tooltip/Tooltip.js +11 -4
- package/cjs/components/Translate/Translate.js +13 -3
- package/cjs/components/Translate/index.js +28 -3
- package/cjs/components/Translate/locale.js +25 -0
- package/cjs/components/VerticalContext/index.js +1 -2
- package/cjs/components/index.js +16 -3
- package/cjs/hooks/useResizeObserver.js +8 -2
- package/cjs/index.js +1 -1
- package/cjs/locales/ar.js +124 -0
- package/cjs/locales/ca-ES.js +124 -0
- package/cjs/locales/cs-CZ.js +124 -0
- package/cjs/locales/da-DK.js +124 -0
- package/cjs/locales/de-DE.js +124 -0
- package/cjs/locales/el-GR.js +124 -0
- package/cjs/locales/en-US.js +124 -0
- package/cjs/locales/es-ES.js +124 -0
- package/cjs/locales/fi-FI.js +124 -0
- package/cjs/locales/fr-FR.js +124 -0
- package/cjs/locales/he-IL.js +124 -0
- package/cjs/locales/hu-HU.js +124 -0
- package/cjs/locales/id-ID.js +124 -0
- package/cjs/locales/index.js +172 -0
- package/cjs/locales/it-IT.js +124 -0
- package/cjs/locales/ja-JP.js +124 -0
- package/cjs/locales/ko-KR.js +124 -0
- package/cjs/locales/ms-MY.js +124 -0
- package/cjs/locales/nb-NO.js +124 -0
- package/cjs/locales/nl-NL.js +124 -0
- package/cjs/locales/pl-PL.js +124 -0
- package/cjs/locales/pt-BR.js +124 -0
- package/cjs/locales/pt-PT.js +124 -0
- package/cjs/locales/ro-RO.js +124 -0
- package/cjs/locales/ru-RU.js +124 -0
- package/cjs/locales/sv-SE.js +124 -0
- package/cjs/locales/th-TH.js +124 -0
- package/cjs/locales/tl-PH.js +124 -0
- package/cjs/locales/tr-TR.js +124 -0
- package/cjs/locales/uk-UA.js +124 -0
- package/cjs/locales/vi-VN.js +124 -0
- package/cjs/locales/zh-CN.js +124 -0
- package/cjs/locales/zh-TW.js +124 -0
- package/cjs/utils.js +17 -2
- 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 +5517 -1054
- 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/Action/Action.js +9 -1
- package/esm/components/Alert/Alert.js +1 -0
- package/esm/components/AutoClosable/AutoClosable.js +48 -62
- package/esm/components/AuxiliaryActions/AuxiliaryActions.js +13 -4
- package/esm/components/Button/Button.js +1 -0
- package/esm/components/Card/Card.js +9 -13
- package/esm/components/CardList/CardList.js +5 -7
- package/esm/components/CardList/CardListToolbar.js +11 -16
- package/esm/components/ClosingConfirmation/useClosingConfirmation.js +7 -11
- package/esm/components/ComboBoxDropdown/ComboBoxDropdown.js +3 -0
- package/esm/components/Cuttable/Cuttable.js +6 -8
- package/esm/components/Dialog/Dialog.js +18 -12
- package/esm/components/Drawer/Drawer.js +15 -8
- package/esm/components/Drawer/DrawerProgress.js +3 -4
- package/esm/components/Dropdown/Dropdown.js +11 -9
- package/esm/components/ExtendedStatusMessage/ExtendedStatusMessage.js +1 -0
- package/esm/components/Form/Form.js +18 -18
- package/esm/components/FormField/FormField.js +77 -51
- package/esm/components/FormFieldCheckbox/FormFieldCheckbox.js +6 -2
- package/esm/components/FormFieldPassword/FormFieldPassword.js +18 -21
- package/esm/components/FormFieldPassword/PasswordMeter.js +8 -13
- package/esm/components/FormFieldPassword/estimatePassword.js +21 -32
- package/esm/components/FormFieldRadioButtons/FormFieldRadioButtons.js +49 -42
- package/esm/components/FormFieldSelect/FormFieldSelect.js +1 -1
- package/esm/components/FormFieldText/FormFieldText.js +7 -1
- package/esm/components/Hint/Hint.js +2 -1
- package/esm/components/Icon/Icon.js +6 -0
- package/esm/components/Icon/utils.js +16 -6
- package/esm/components/InPlaceEdit/Editor.js +5 -8
- package/esm/components/InPlaceEdit/InPlaceEdit.js +3 -5
- package/esm/components/InputFile/InputFile.js +7 -9
- package/esm/components/Layout/Layout.js +2 -2
- package/esm/components/Link/Link.js +2 -0
- package/esm/components/List/List.js +37 -43
- package/esm/components/List/ListAction.js +1 -0
- package/esm/components/List/ListActions.js +1 -0
- package/esm/components/List/ListEmptyView.js +7 -10
- package/esm/components/List/ListOperation.js +3 -12
- package/esm/components/LocaleProvider/LocaleProvider.js +18 -11
- package/esm/components/Menu/Menu.js +10 -8
- package/esm/components/Menu/MenuItem.js +2 -1
- package/esm/components/Overlay/Overlay.js +2 -0
- package/esm/components/Pagination/Pagination.js +6 -10
- package/esm/components/Popover/Popover.js +1 -1
- package/esm/components/ProgressDialog/ProgressDialog.js +5 -7
- package/esm/components/Section/Section.js +88 -224
- package/esm/components/Section/SectionContext.js +5 -0
- package/esm/components/Section/useCollapsed.js +12 -0
- package/esm/components/Section/useVertical.js +30 -0
- package/esm/components/SegmentedControl/SegmentedControl.js +1 -0
- package/esm/components/Select/Select.js +10 -6
- package/esm/components/Select/SelectControl.js +14 -4
- package/esm/components/Spot/SpotPopup.js +3 -4
- package/esm/components/Status/Status.js +1 -0
- package/esm/components/Tabs/TabList.js +29 -12
- package/esm/components/Tabs/TabListItem.js +5 -1
- package/esm/components/Tabs/Tabs.js +17 -13
- package/esm/components/Tabs/useWidths.js +5 -5
- package/esm/components/Toast/Toast.js +1 -0
- package/esm/components/Toaster/GroupLabel.js +5 -3
- package/esm/components/Tooltip/Tooltip.js +11 -4
- package/esm/components/Translate/Translate.js +11 -2
- package/esm/components/Translate/index.js +3 -2
- package/esm/components/Translate/locale.js +15 -0
- package/esm/components/index.js +1 -1
- package/esm/hooks/useResizeObserver.js +8 -2
- package/esm/index.js +1 -1
- package/esm/locales/ar.js +119 -0
- package/esm/locales/ca-ES.js +119 -0
- package/esm/locales/cs-CZ.js +119 -0
- package/esm/locales/da-DK.js +119 -0
- package/esm/locales/de-DE.js +119 -0
- package/esm/locales/el-GR.js +119 -0
- package/esm/locales/en-US.js +119 -0
- package/esm/locales/es-ES.js +119 -0
- package/esm/locales/fi-FI.js +119 -0
- package/esm/locales/fr-FR.js +119 -0
- package/esm/locales/he-IL.js +119 -0
- package/esm/locales/hu-HU.js +119 -0
- package/esm/locales/id-ID.js +119 -0
- package/esm/locales/index.js +165 -0
- package/esm/locales/it-IT.js +119 -0
- package/esm/locales/ja-JP.js +119 -0
- package/esm/locales/ko-KR.js +119 -0
- package/esm/locales/ms-MY.js +119 -0
- package/esm/locales/nb-NO.js +119 -0
- package/esm/locales/nl-NL.js +119 -0
- package/esm/locales/pl-PL.js +119 -0
- package/esm/locales/pt-BR.js +119 -0
- package/esm/locales/pt-PT.js +119 -0
- package/esm/locales/ro-RO.js +119 -0
- package/esm/locales/ru-RU.js +119 -0
- package/esm/locales/sv-SE.js +119 -0
- package/esm/locales/th-TH.js +119 -0
- package/esm/locales/tl-PH.js +119 -0
- package/esm/locales/tr-TR.js +119 -0
- package/esm/locales/uk-UA.js +119 -0
- package/esm/locales/vi-VN.js +119 -0
- package/esm/locales/zh-CN.js +119 -0
- package/esm/locales/zh-TW.js +119 -0
- package/esm/utils.js +14 -0
- package/package.json +4 -4
- package/styleguide/build/bundle.cf3363eb.js +2 -0
- package/styleguide/index.html +2 -2
- package/types/components/AutoClosable/AutoClosable.d.ts +5 -37
- package/types/components/Button/Button.d.ts +2 -2
- package/types/components/ComboBoxDropdown/ComboBoxDropdown.d.ts +2 -1
- package/types/components/Form/types.d.ts +2 -0
- package/types/components/FormField/FormField.d.ts +6 -0
- package/types/components/FormFieldSelect/FormFieldSelect.d.ts +1 -1
- package/types/components/Hint/Hint.d.ts +11 -8
- package/types/components/Icon/Icon.d.ts +5 -0
- package/types/components/Input/Input.d.ts +2 -2
- package/types/components/LocaleProvider/LocaleProvider.d.ts +3 -2
- package/types/components/Menu/Menu.d.ts +5 -0
- package/types/components/Menu/MenuItem.d.ts +6 -1
- package/types/components/Overlay/Overlay.d.ts +4 -0
- package/types/components/Popover/Popover.d.ts +1 -1
- package/types/components/Section/Section.d.ts +3 -46
- package/types/components/Section/SectionContext.d.ts +5 -0
- package/types/components/Section/useCollapsed.d.ts +1 -0
- package/types/components/Section/useVertical.d.ts +2 -0
- package/types/components/Select/SelectControl.d.ts +2 -0
- package/types/components/Tabs/TabList.d.ts +3 -1
- package/types/components/Tabs/TabListItem.d.ts +4 -1
- package/types/components/Tabs/useWidths.d.ts +2 -2
- package/types/components/Tooltip/Tooltip.d.ts +1 -0
- package/types/components/Translate/Translate.d.ts +7 -1
- package/types/components/Translate/index.d.ts +2 -1
- package/types/components/Translate/locale.d.ts +4 -0
- package/types/components/index.d.ts +1 -1
- package/types/hooks/useResizeObserver.d.ts +2 -1
- package/types/locales/index.d.ts +10 -0
- package/types/utils.d.ts +3 -0
- package/cjs/components/ClosingConfirmation/locale/en-US.js +0 -12
- package/cjs/components/FormFieldPassword/locale/en-US.js +0 -33
- package/cjs/components/InPlaceEdit/locale/en-US.js +0 -12
- package/cjs/components/InputFile/locale/en-US.js +0 -10
- package/esm/components/ClosingConfirmation/locale/en-US.js +0 -7
- package/esm/components/Dropdown/locale/en-US.js +0 -5
- package/esm/components/FormFieldPassword/locale/en-US.js +0 -28
- package/esm/components/InPlaceEdit/locale/en-US.js +0 -7
- package/esm/components/InputFile/locale/en-US.js +0 -5
- package/styleguide/build/bundle.2360aa9e.js +0 -2
- package/types/components/InPlaceEdit/locale/en-US.d.ts +0 -6
- /package/styleguide/build/{bundle.2360aa9e.js.LICENSE.txt → bundle.cf3363eb.js.LICENSE.txt} +0 -0
|
@@ -6,6 +6,7 @@ import { CLS_PREFIX } from '../../constants';
|
|
|
6
6
|
import { wrapFunction } from '../utils';
|
|
7
7
|
import Icon, { ICON_SIZE_16 } from '../Icon';
|
|
8
8
|
import Spinner from '../Spinner';
|
|
9
|
+
import { prepareIconName } from '../../utils';
|
|
9
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
11
|
/**
|
|
11
12
|
* `Action` component is used mostly for navigation, to go between pages, and not for immediate action or submitting data.
|
|
@@ -59,6 +60,7 @@ const Action = _ref => {
|
|
|
59
60
|
// accessibility
|
|
60
61
|
if (onClick) {
|
|
61
62
|
tagProps.tabIndex = tagProps.tabIndex || 0;
|
|
63
|
+
tagProps.role = 'button';
|
|
62
64
|
tagProps.onKeyDown = wrapFunction(tagProps.onKeyDown, e => {
|
|
63
65
|
if (e.key === 'Enter') {
|
|
64
66
|
e.preventDefault();
|
|
@@ -66,13 +68,19 @@ const Action = _ref => {
|
|
|
66
68
|
}
|
|
67
69
|
});
|
|
68
70
|
}
|
|
71
|
+
const isIconOnly = !Children.toArray(children).length && !rightAddon && !bottomAddon;
|
|
72
|
+
|
|
73
|
+
// Add aria-label when only icon is defined
|
|
74
|
+
if (isIconOnly && icon) {
|
|
75
|
+
tagProps['aria-label'] = prepareIconName(icon, isIconOnly);
|
|
76
|
+
}
|
|
69
77
|
return /*#__PURE__*/_jsxs(RootTag, {
|
|
70
78
|
className: classNames(baseClassName, {
|
|
71
79
|
[`${baseClassName}--size-${size}`]: icon || progress,
|
|
72
80
|
[`${baseClassName}--progress`]: progress,
|
|
73
81
|
[`${baseClassName}--primary`]: primary,
|
|
74
82
|
[`${baseClassName}--nowrap`]: nowrap,
|
|
75
|
-
[`${baseClassName}--icon`]:
|
|
83
|
+
[`${baseClassName}--icon`]: isIconOnly
|
|
76
84
|
}, className),
|
|
77
85
|
...restOuterProps,
|
|
78
86
|
children: [/*#__PURE__*/_jsxs(Tag, {
|
|
@@ -22,6 +22,7 @@ const Alert = _ref => {
|
|
|
22
22
|
className: classNames(baseClassName, {
|
|
23
23
|
[`${baseClassName}--${intent}`]: intent
|
|
24
24
|
}, className),
|
|
25
|
+
role: intent === 'warning' || intent === 'danger' ? 'alert' : 'status',
|
|
25
26
|
...props,
|
|
26
27
|
children: [onClose && /*#__PURE__*/_jsx("span", {
|
|
27
28
|
className: "close",
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import { Component, Children, createContext } from 'react';
|
|
4
|
+
import { useContext, useEffect, useRef, createContext } from 'react';
|
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
* @since 0.0.42
|
|
11
|
-
*/
|
|
12
|
-
class AutoClosable extends Component {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments);
|
|
15
|
-
_defineProperty(this, "context", void 0);
|
|
6
|
+
class AutoClosableContextApi {
|
|
7
|
+
constructor(ignoreNodesRef) {
|
|
8
|
+
this.ignoreNodesRef = ignoreNodesRef;
|
|
16
9
|
_defineProperty(this, "children", []);
|
|
17
10
|
_defineProperty(this, "addChild", child => {
|
|
18
11
|
this.children.push(child);
|
|
@@ -21,61 +14,54 @@ class AutoClosable extends Component {
|
|
|
21
14
|
this.children = this.children.filter(item => item !== child);
|
|
22
15
|
});
|
|
23
16
|
_defineProperty(this, "getIgnoreNodes", () => {
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
} = this.props;
|
|
27
|
-
const nodes = typeof ignoreNodes === 'function' ? ignoreNodes() : [];
|
|
28
|
-
nodes.push(this);
|
|
29
|
-
this.children.forEach(child => child.getIgnoreNodes().forEach(node => nodes.push(node)));
|
|
30
|
-
return nodes;
|
|
17
|
+
const nodes = [...this.ignoreNodesRef.current(), ...this.children.map(child => child.getIgnoreNodes()).flat()];
|
|
18
|
+
return nodes.filter(node => node instanceof Node);
|
|
31
19
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
const AutoClosableContext = /*#__PURE__*/createContext(null);
|
|
23
|
+
/**
|
|
24
|
+
* This is helper component for handling outside clicks.
|
|
25
|
+
* @since 0.0.42
|
|
26
|
+
*/
|
|
27
|
+
const AutoClosable = _ref => {
|
|
28
|
+
let {
|
|
29
|
+
onClose,
|
|
30
|
+
ignoreNodes,
|
|
31
|
+
nodeRef,
|
|
32
|
+
children
|
|
33
|
+
} = _ref;
|
|
34
|
+
const onCloseRef = useRef(onClose);
|
|
35
|
+
onCloseRef.current = onClose;
|
|
36
|
+
const getIgnoreNodes = () => [nodeRef?.current ?? null, ...(ignoreNodes?.() ?? [])];
|
|
37
|
+
const ignoreNodesRef = useRef(getIgnoreNodes);
|
|
38
|
+
ignoreNodesRef.current = getIgnoreNodes;
|
|
39
|
+
const parentContext = useContext(AutoClosableContext);
|
|
40
|
+
const autoClosableApi = useRef(new AutoClosableContextApi(ignoreNodesRef)).current;
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
const handleClickOutside = event => {
|
|
43
|
+
const element = event.target;
|
|
44
|
+
const ignoreNodes = autoClosableApi.getIgnoreNodes();
|
|
45
|
+
const isClickOnIgnoredNode = element instanceof Node && ignoreNodes.some(node => node.contains(element));
|
|
49
46
|
if (isClickOnIgnoredNode) {
|
|
50
47
|
return;
|
|
51
48
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
componentDidMount() {
|
|
58
|
-
document.body.addEventListener('click', this.onOutsideClick, {
|
|
49
|
+
onCloseRef.current?.();
|
|
50
|
+
};
|
|
51
|
+
parentContext?.addChild(autoClosableApi);
|
|
52
|
+
document.body.addEventListener('click', handleClickOutside, {
|
|
59
53
|
capture: true
|
|
60
54
|
});
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
render() {
|
|
74
|
-
return /*#__PURE__*/_jsx(AutoClosableContext.Provider, {
|
|
75
|
-
value: this,
|
|
76
|
-
children: Children.only(this.props.children)
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
AutoClosable.contextType = AutoClosableContext;
|
|
55
|
+
return () => {
|
|
56
|
+
parentContext?.removeChild(autoClosableApi);
|
|
57
|
+
document.body.removeEventListener('click', handleClickOutside, {
|
|
58
|
+
capture: true
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
}, [parentContext, autoClosableApi]);
|
|
62
|
+
return /*#__PURE__*/_jsx(AutoClosableContext.Provider, {
|
|
63
|
+
value: autoClosableApi,
|
|
64
|
+
children: children
|
|
65
|
+
});
|
|
66
|
+
};
|
|
81
67
|
export default AutoClosable;
|
|
@@ -22,10 +22,19 @@ const AuxiliaryActions = _ref => {
|
|
|
22
22
|
return /*#__PURE__*/_jsx("span", {
|
|
23
23
|
className: classNames(baseClassName, className),
|
|
24
24
|
...props,
|
|
25
|
-
children: Children.toArray(children).reduce((accu, elem, index) =>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
children: Children.toArray(children).reduce((accu, elem, index) => {
|
|
26
|
+
let elementWithRole = elem;
|
|
27
|
+
if (/*#__PURE__*/isValidElement(elem)) {
|
|
28
|
+
// @ts-expect-error
|
|
29
|
+
elementWithRole = /*#__PURE__*/cloneElement(elem, {
|
|
30
|
+
role: 'button'
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
return accu.length === 0 ? [elementWithRole] : [...accu, /*#__PURE__*/isValidElement(separator) ? /*#__PURE__*/cloneElement(separator, {
|
|
34
|
+
key: index
|
|
35
|
+
}) // eslint-disable-line react/no-array-index-key
|
|
36
|
+
: separator, elementWithRole];
|
|
37
|
+
}, [])
|
|
29
38
|
});
|
|
30
39
|
};
|
|
31
40
|
export default AuxiliaryActions;
|
|
@@ -132,6 +132,7 @@ const Button = /*#__PURE__*/forwardRef((_ref3, ref) => {
|
|
|
132
132
|
const hasAriaDisabled = Tag === 'button' && disabled && tooltip;
|
|
133
133
|
let button = /*#__PURE__*/_jsxs(Tag, {
|
|
134
134
|
ref: ref,
|
|
135
|
+
role: Tag === 'button' ? undefined : 'button',
|
|
135
136
|
className: classNames(baseClassName, {
|
|
136
137
|
[`${baseClassName}--${size}`]: size,
|
|
137
138
|
[`${baseClassName}--${intent}`]: intent && !ghost,
|
|
@@ -9,7 +9,7 @@ import { CSSTransition } from 'react-transition-group';
|
|
|
9
9
|
import Checkbox from '../Checkbox';
|
|
10
10
|
import Dropdown from '../Dropdown';
|
|
11
11
|
import ContentLoader from '../ContentLoader';
|
|
12
|
-
import
|
|
12
|
+
import { InternalTranslate } from '../Translate';
|
|
13
13
|
import CardButton from './CardButton';
|
|
14
14
|
import PreviewPanel from './PreviewPanel';
|
|
15
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -68,9 +68,8 @@ class Card extends Component {
|
|
|
68
68
|
onChange: isSelected => onSelectionChange({
|
|
69
69
|
isSelected
|
|
70
70
|
}),
|
|
71
|
-
children: this.isExtended() ? /*#__PURE__*/_jsx(
|
|
72
|
-
content: "Card.select"
|
|
73
|
-
fallback: "Select"
|
|
71
|
+
children: this.isExtended() ? /*#__PURE__*/_jsx(InternalTranslate, {
|
|
72
|
+
content: "Card.select"
|
|
74
73
|
}) : null
|
|
75
74
|
})
|
|
76
75
|
});
|
|
@@ -92,9 +91,8 @@ class Card extends Component {
|
|
|
92
91
|
}), titleLinkProps && /*#__PURE__*/_jsx(CardButton, {
|
|
93
92
|
component: "a",
|
|
94
93
|
icon: "chain",
|
|
95
|
-
tooltip: /*#__PURE__*/_jsx(
|
|
96
|
-
content: "Card.titleLinkTooltip"
|
|
97
|
-
fallback: "Go to page"
|
|
94
|
+
tooltip: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
95
|
+
content: "Card.titleLinkTooltip"
|
|
98
96
|
}),
|
|
99
97
|
...titleLinkProps
|
|
100
98
|
}), this.isExtended() && this.renderTitleLabels()]
|
|
@@ -214,12 +212,10 @@ class Card extends Component {
|
|
|
214
212
|
flipVertical: this.isExtended()
|
|
215
213
|
},
|
|
216
214
|
onClick: this.handleToggleView,
|
|
217
|
-
tooltip: this.isExtended() ? /*#__PURE__*/_jsx(
|
|
218
|
-
content: "Card.collapseCardTooltip"
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
content: "Card.expandCardTooltip",
|
|
222
|
-
fallback: "Expand the card"
|
|
215
|
+
tooltip: this.isExtended() ? /*#__PURE__*/_jsx(InternalTranslate, {
|
|
216
|
+
content: "Card.collapseCardTooltip"
|
|
217
|
+
}) : /*#__PURE__*/_jsx(InternalTranslate, {
|
|
218
|
+
content: "Card.expandCardTooltip"
|
|
223
219
|
})
|
|
224
220
|
}, "toggleView"));
|
|
225
221
|
}
|
|
@@ -12,7 +12,7 @@ import Grid from '../Grid';
|
|
|
12
12
|
import GridCol from '../GridCol';
|
|
13
13
|
import Button from '../Button';
|
|
14
14
|
import Spinner from '../Spinner';
|
|
15
|
-
import
|
|
15
|
+
import { InternalTranslate } from '../Translate';
|
|
16
16
|
import CardListToolbar from './CardListToolbar';
|
|
17
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
18
|
export const VIEW_TILE = 'tile';
|
|
@@ -185,9 +185,8 @@ class CardList extends Component {
|
|
|
185
185
|
className: `${baseClassName}__pagination`,
|
|
186
186
|
children: /*#__PURE__*/_jsx(Button, {
|
|
187
187
|
onClick: () => this.loadMore(),
|
|
188
|
-
children: /*#__PURE__*/_jsx(
|
|
189
|
-
content: 'CardList.loadMore'
|
|
190
|
-
fallback: 'Load more'
|
|
188
|
+
children: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
189
|
+
content: 'CardList.loadMore'
|
|
191
190
|
})
|
|
192
191
|
})
|
|
193
192
|
});
|
|
@@ -306,9 +305,8 @@ class CardList extends Component {
|
|
|
306
305
|
}), this.state.items.length > 0 && /*#__PURE__*/_jsx("div", {
|
|
307
306
|
className: `${baseClassName}__list ${baseClassName}__list--${this.state.view}`,
|
|
308
307
|
children: content
|
|
309
|
-
}), this.state.items.length === 0 && !loading && /*#__PURE__*/_jsx(
|
|
310
|
-
content: "CardList.notFound"
|
|
311
|
-
fallback: "No items found."
|
|
308
|
+
}), this.state.items.length === 0 && !loading && /*#__PURE__*/_jsx(InternalTranslate, {
|
|
309
|
+
content: "CardList.notFound"
|
|
312
310
|
}), this.renderPagination(), this.renderLoader()]
|
|
313
311
|
});
|
|
314
312
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import React, { isValidElement } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { CLS_PREFIX } from '../../constants';
|
|
6
|
-
import
|
|
6
|
+
import { InternalTranslate } from '../Translate';
|
|
7
7
|
import Button from '../Button';
|
|
8
8
|
import Toolbar, { ToolbarGroup, ToolbarExpander } from '../Toolbar';
|
|
9
9
|
import Dropdown from '../Dropdown';
|
|
@@ -66,9 +66,8 @@ const renderSelection = (_ref, baseClassName) => {
|
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
return /*#__PURE__*/_jsx(ToolbarGroup, {
|
|
69
|
-
title: /*#__PURE__*/_jsx(
|
|
70
|
-
content: "CardList.toolbarSelect"
|
|
71
|
-
fallback: "Select"
|
|
69
|
+
title: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
70
|
+
content: "CardList.toolbarSelect"
|
|
72
71
|
}),
|
|
73
72
|
children: button
|
|
74
73
|
}, "selection");
|
|
@@ -76,30 +75,26 @@ const renderSelection = (_ref, baseClassName) => {
|
|
|
76
75
|
const renderView = (onViewChange, currentView) => {
|
|
77
76
|
const viewButtons = [{
|
|
78
77
|
value: VIEW_EXTENDED,
|
|
79
|
-
title: /*#__PURE__*/_jsx(
|
|
80
|
-
content: "CardList.viewCards"
|
|
81
|
-
fallback: "Cards"
|
|
78
|
+
title: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
79
|
+
content: "CardList.viewCards"
|
|
82
80
|
}),
|
|
83
81
|
icon: 'site-page'
|
|
84
82
|
}, {
|
|
85
83
|
value: VIEW_TILE,
|
|
86
|
-
title: /*#__PURE__*/_jsx(
|
|
87
|
-
content: "CardList.viewTiles"
|
|
88
|
-
fallback: "Tiles"
|
|
84
|
+
title: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
85
|
+
content: "CardList.viewTiles"
|
|
89
86
|
}),
|
|
90
87
|
icon: 'four-squares'
|
|
91
88
|
}, {
|
|
92
89
|
value: VIEW_ROW,
|
|
93
|
-
title: /*#__PURE__*/_jsx(
|
|
94
|
-
content: "CardList.viewList"
|
|
95
|
-
fallback: "List"
|
|
90
|
+
title: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
91
|
+
content: "CardList.viewList"
|
|
96
92
|
}),
|
|
97
93
|
icon: 'list'
|
|
98
94
|
}];
|
|
99
95
|
return /*#__PURE__*/_jsx(ToolbarGroup, {
|
|
100
|
-
title: /*#__PURE__*/_jsx(
|
|
101
|
-
content: "CardList.toolbarView"
|
|
102
|
-
fallback: "View"
|
|
96
|
+
title: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
97
|
+
content: "CardList.toolbarView"
|
|
103
98
|
}),
|
|
104
99
|
children: /*#__PURE__*/_jsx(SegmentedControl, {
|
|
105
100
|
buttons: viewButtons,
|
|
@@ -4,9 +4,8 @@ import { useState } from 'react';
|
|
|
4
4
|
import Button from '../Button';
|
|
5
5
|
import Dialog from '../Dialog';
|
|
6
6
|
import Paragraph from '../Paragraph';
|
|
7
|
-
import
|
|
7
|
+
import { InternalTranslate } from '../Translate';
|
|
8
8
|
import { safeInvoke } from '../utils';
|
|
9
|
-
import locale from './locale/en-US';
|
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
10
|
const useClosingConfirmation = _ref => {
|
|
12
11
|
let {
|
|
@@ -42,22 +41,19 @@ const useClosingConfirmation = _ref => {
|
|
|
42
41
|
buttons: [/*#__PURE__*/_jsx(Button, {
|
|
43
42
|
intent: "primary",
|
|
44
43
|
onClick: handleCancel,
|
|
45
|
-
children: /*#__PURE__*/_jsx(
|
|
46
|
-
content: "ClosingConfirmation.cancel"
|
|
47
|
-
fallback: locale.cancel
|
|
44
|
+
children: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
45
|
+
content: "ClosingConfirmation.cancel"
|
|
48
46
|
})
|
|
49
47
|
}, "cancel"), /*#__PURE__*/_jsx(Button, {
|
|
50
48
|
onClick: handleConfirm,
|
|
51
|
-
children: /*#__PURE__*/_jsx(
|
|
52
|
-
content: "ClosingConfirmation.confirm"
|
|
53
|
-
fallback: locale.confirm
|
|
49
|
+
children: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
50
|
+
content: "ClosingConfirmation.confirm"
|
|
54
51
|
})
|
|
55
52
|
}, "confirm")],
|
|
56
53
|
cancelButton: false,
|
|
57
54
|
children: /*#__PURE__*/_jsx(Paragraph, {
|
|
58
|
-
children: /*#__PURE__*/_jsx(
|
|
59
|
-
content: "ClosingConfirmation.content"
|
|
60
|
-
fallback: locale.content
|
|
55
|
+
children: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
56
|
+
content: "ClosingConfirmation.content"
|
|
61
57
|
})
|
|
62
58
|
})
|
|
63
59
|
});
|
|
@@ -41,6 +41,7 @@ const ComboBoxDropdown = _ref => {
|
|
|
41
41
|
onSelect,
|
|
42
42
|
noOptions,
|
|
43
43
|
emitter,
|
|
44
|
+
listboxId,
|
|
44
45
|
...props
|
|
45
46
|
} = _ref;
|
|
46
47
|
const rootRef = useRef(null);
|
|
@@ -111,6 +112,8 @@ const ComboBoxDropdown = _ref => {
|
|
|
111
112
|
},
|
|
112
113
|
ref: menuRef,
|
|
113
114
|
className: `${baseClassName}__menu`,
|
|
115
|
+
role: "listbox",
|
|
116
|
+
id: listboxId,
|
|
114
117
|
children: [groups.reduce((acc, group) => {
|
|
115
118
|
if (group.label) {
|
|
116
119
|
acc.push(/*#__PURE__*/_createElement(MenuHeader, {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useRef, useState } from 'react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { CLS_PREFIX } from '../../constants';
|
|
6
|
-
import
|
|
6
|
+
import { InternalTranslate } from '../Translate';
|
|
7
7
|
import Link from '../Link';
|
|
8
8
|
import { useContentOverflow } from './useContentOverflow';
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -16,10 +16,7 @@ const Cuttable = _ref => {
|
|
|
16
16
|
children,
|
|
17
17
|
collapsed: externalCollapsed = true,
|
|
18
18
|
maxHeight = '7rem',
|
|
19
|
-
locale
|
|
20
|
-
showMore: 'Show more',
|
|
21
|
-
showLess: 'Show less'
|
|
22
|
-
},
|
|
19
|
+
locale,
|
|
23
20
|
className,
|
|
24
21
|
baseClassName = `${CLS_PREFIX}cuttable`,
|
|
25
22
|
...props
|
|
@@ -63,9 +60,10 @@ const Cuttable = _ref => {
|
|
|
63
60
|
className: `${baseClassName}__action`,
|
|
64
61
|
children: /*#__PURE__*/_jsx(Link, {
|
|
65
62
|
onClick: toggle,
|
|
66
|
-
children: /*#__PURE__*/_jsx(
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
children: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
64
|
+
namespace: "Cuttable",
|
|
65
|
+
content: actionLocaleKey,
|
|
66
|
+
translators: locale
|
|
69
67
|
})
|
|
70
68
|
})
|
|
71
69
|
})]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.
|
|
2
2
|
|
|
3
|
-
import { isValidElement, cloneElement, useEffect, useState } from 'react';
|
|
3
|
+
import { isValidElement, cloneElement, useEffect, useState, useId } from 'react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { CLS_PREFIX } from '../../constants';
|
|
6
6
|
import Overlay from '../Overlay';
|
|
@@ -9,7 +9,7 @@ import Form from '../Form';
|
|
|
9
9
|
import Button from '../Button';
|
|
10
10
|
import Heading from '../Heading';
|
|
11
11
|
import Text from '../Text';
|
|
12
|
-
import
|
|
12
|
+
import { isLikeText, InternalTranslate } from '../Translate';
|
|
13
13
|
import { safeInvoke } from '../utils';
|
|
14
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
15
|
const isProps = value => value && typeof value === 'object' && ! /*#__PURE__*/isValidElement(value);
|
|
@@ -91,9 +91,8 @@ const Dialog = _ref => {
|
|
|
91
91
|
}
|
|
92
92
|
let props = {
|
|
93
93
|
onClick: onCloseWithConfirmation,
|
|
94
|
-
children: cancelTitle || /*#__PURE__*/_jsx(
|
|
95
|
-
content: "Dialog.cancelButton"
|
|
96
|
-
fallback: "Cancel"
|
|
94
|
+
children: cancelTitle || /*#__PURE__*/_jsx(InternalTranslate, {
|
|
95
|
+
content: "Dialog.cancelButton"
|
|
97
96
|
})
|
|
98
97
|
};
|
|
99
98
|
if (formProps && isProps(formProps.cancelButton)) {
|
|
@@ -148,6 +147,7 @@ const Dialog = _ref => {
|
|
|
148
147
|
} else {
|
|
149
148
|
childrenElement = children;
|
|
150
149
|
}
|
|
150
|
+
const titleContainerId = useId();
|
|
151
151
|
return /*#__PURE__*/_jsxs(Overlay, {
|
|
152
152
|
className: classNames(baseClassName, className),
|
|
153
153
|
isOpen: isVisible,
|
|
@@ -155,6 +155,9 @@ const Dialog = _ref => {
|
|
|
155
155
|
canCloseOnBackdropClick: canClose && closable,
|
|
156
156
|
canCloseOnEscapePress: canClose && closable,
|
|
157
157
|
size: size,
|
|
158
|
+
containerProps: {
|
|
159
|
+
'aria-labelledby': title ? titleContainerId : undefined
|
|
160
|
+
},
|
|
158
161
|
...props,
|
|
159
162
|
children: [(title || subtitle || actions) && /*#__PURE__*/_jsxs("header", {
|
|
160
163
|
className: `${baseClassName}__header`,
|
|
@@ -164,13 +167,16 @@ const Dialog = _ref => {
|
|
|
164
167
|
className: `${baseClassName}__header-body`,
|
|
165
168
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
166
169
|
className: `${baseClassName}__header-content`,
|
|
167
|
-
children: [
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
170
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
171
|
+
id: titleContainerId,
|
|
172
|
+
children: isLikeText(title) ? /*#__PURE__*/_jsx(Heading, {
|
|
173
|
+
level: 2,
|
|
174
|
+
className: `${baseClassName}__title`,
|
|
175
|
+
children: title
|
|
176
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
177
|
+
className: `${baseClassName}__title`,
|
|
178
|
+
children: title
|
|
179
|
+
})
|
|
174
180
|
}), subtitle && /*#__PURE__*/_jsx("div", {
|
|
175
181
|
className: `${baseClassName}__subtitle`,
|
|
176
182
|
children: isLikeText(subtitle) ? /*#__PURE__*/_jsx(Text, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Copyright 1999-2025. WebPros International GmbH. All rights reserved.
|
|
2
2
|
|
|
3
|
-
import { Fragment, isValidElement, cloneElement, useRef, useState } from 'react';
|
|
3
|
+
import { Fragment, isValidElement, cloneElement, useRef, useState, useId } from 'react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { CLS_PREFIX } from '../../constants';
|
|
6
6
|
import Overlay from '../Overlay';
|
|
@@ -118,6 +118,7 @@ const Drawer = _ref => {
|
|
|
118
118
|
})
|
|
119
119
|
});
|
|
120
120
|
};
|
|
121
|
+
const titleContainerId = useId();
|
|
121
122
|
return /*#__PURE__*/_jsxs(Overlay, {
|
|
122
123
|
className: classNames(baseClassName, {
|
|
123
124
|
[`${baseClassName}--form`]: form
|
|
@@ -127,6 +128,9 @@ const Drawer = _ref => {
|
|
|
127
128
|
isOpen: isOpen,
|
|
128
129
|
placement: placement,
|
|
129
130
|
size: size,
|
|
131
|
+
containerProps: {
|
|
132
|
+
'aria-labelledby': titleContainerId
|
|
133
|
+
},
|
|
130
134
|
...props,
|
|
131
135
|
children: [takeApart(_ref5 => {
|
|
132
136
|
let {
|
|
@@ -139,13 +143,16 @@ const Drawer = _ref => {
|
|
|
139
143
|
hideButton: typeof hideButton === 'boolean' ? hideButton : Boolean(progress && !isClosable),
|
|
140
144
|
onClose: onCloseWithConfirmation,
|
|
141
145
|
tabs: tabs,
|
|
142
|
-
children: [
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
147
|
+
id: titleContainerId,
|
|
148
|
+
children: isLikeText(title) ? /*#__PURE__*/_jsx(Heading, {
|
|
149
|
+
level: 2,
|
|
150
|
+
className: `${baseClassName}__title`,
|
|
151
|
+
children: title
|
|
152
|
+
}) : /*#__PURE__*/_jsx("div", {
|
|
153
|
+
className: `${baseClassName}__title`,
|
|
154
|
+
children: title
|
|
155
|
+
})
|
|
149
156
|
}), subtitle && /*#__PURE__*/_jsx("div", {
|
|
150
157
|
className: `${baseClassName}__subtitle`,
|
|
151
158
|
children: subtitle
|
|
@@ -4,7 +4,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
4
4
|
import { Component, Fragment } from 'react';
|
|
5
5
|
import Button from '../Button';
|
|
6
6
|
import { ButtonContext, getButtonContextValue } from '../Button/ButtonContext';
|
|
7
|
-
import
|
|
7
|
+
import { InternalTranslate } from '../Translate';
|
|
8
8
|
import Progress from '../Progress';
|
|
9
9
|
import ProgressStep, { STATUS_DONE, STATUS_ERROR, STATUS_NOT_STARTED } from '../ProgressStep';
|
|
10
10
|
import { CLS_PREFIX } from '../../constants';
|
|
@@ -128,9 +128,8 @@ class DrawerProgress extends Component {
|
|
|
128
128
|
}), canCancel && /*#__PURE__*/_jsx(Button, {
|
|
129
129
|
onClick: this.handleCancel,
|
|
130
130
|
size: "lg",
|
|
131
|
-
children: /*#__PURE__*/_jsx(
|
|
132
|
-
content: "DrawerProgress.cancelButton"
|
|
133
|
-
fallback: "Cancel"
|
|
131
|
+
children: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
132
|
+
content: "DrawerProgress.cancelButton"
|
|
134
133
|
})
|
|
135
134
|
})]
|
|
136
135
|
}) : null;
|
|
@@ -10,13 +10,13 @@ import AutoClosable from '../AutoClosable';
|
|
|
10
10
|
import Popper from '../Popper';
|
|
11
11
|
import Layer from '../Layer';
|
|
12
12
|
import { MenuItem, MenuDivider } from '../Menu';
|
|
13
|
-
import Translate from '../Translate';
|
|
14
|
-
import localeFallback from './locale/en-US';
|
|
13
|
+
import Translate, { InternalTranslate } from '../Translate';
|
|
15
14
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
15
|
const createTarget = (node, _ref) => {
|
|
17
16
|
let {
|
|
18
17
|
onToggle,
|
|
19
|
-
targetRef
|
|
18
|
+
targetRef,
|
|
19
|
+
opened
|
|
20
20
|
} = _ref;
|
|
21
21
|
if (!(/*#__PURE__*/isValidElement(node) && node.type !== Translate)) {
|
|
22
22
|
node = /*#__PURE__*/_jsx(Button, {
|
|
@@ -34,7 +34,8 @@ const createTarget = (node, _ref) => {
|
|
|
34
34
|
onToggle(isKeyboardEvent);
|
|
35
35
|
isKeyboardEvent = false;
|
|
36
36
|
}),
|
|
37
|
-
'aria-haspopup':
|
|
37
|
+
'aria-haspopup': 'listbox',
|
|
38
|
+
'aria-expanded': opened
|
|
38
39
|
});
|
|
39
40
|
};
|
|
40
41
|
const computePlacement = placement => {
|
|
@@ -94,11 +95,10 @@ const useEnhancedMenu = (menu, _ref2) => {
|
|
|
94
95
|
className: `${baseClassName}__overlay-menu-divider`
|
|
95
96
|
}, "divider"), /*#__PURE__*/_jsx(MenuItem, {
|
|
96
97
|
onClick: handleClose,
|
|
97
|
-
children: /*#__PURE__*/_jsx(
|
|
98
|
+
children: /*#__PURE__*/_jsx(InternalTranslate, {
|
|
98
99
|
namespace: "Dropdown",
|
|
99
100
|
content: "close",
|
|
100
|
-
translators: locale
|
|
101
|
-
fallback: localeFallback.close
|
|
101
|
+
translators: locale
|
|
102
102
|
})
|
|
103
103
|
}, "close")];
|
|
104
104
|
}
|
|
@@ -109,7 +109,8 @@ const useEnhancedMenu = (menu, _ref2) => {
|
|
|
109
109
|
ref: menuRef,
|
|
110
110
|
children,
|
|
111
111
|
onKeyDown: handleKeyDown,
|
|
112
|
-
autoFocus
|
|
112
|
+
autoFocus,
|
|
113
|
+
role: 'listbox'
|
|
113
114
|
});
|
|
114
115
|
return {
|
|
115
116
|
enhancedMenu: clone,
|
|
@@ -162,7 +163,8 @@ const Dropdown = _ref3 => {
|
|
|
162
163
|
const targetRef = useRef();
|
|
163
164
|
const target = createTarget(children, {
|
|
164
165
|
onToggle: handleOpen,
|
|
165
|
-
targetRef
|
|
166
|
+
targetRef,
|
|
167
|
+
opened
|
|
166
168
|
});
|
|
167
169
|
return /*#__PURE__*/_jsx("div", {
|
|
168
170
|
className: classNames(baseClassName, {
|
|
@@ -26,6 +26,7 @@ const ExtendedStatusMessage = _ref => {
|
|
|
26
26
|
[`${baseClassName}--${intent}`]: intent,
|
|
27
27
|
[`${baseClassName}--loading`]: loading
|
|
28
28
|
}, className),
|
|
29
|
+
role: intent === 'warning' || intent === 'danger' ? 'alert' : 'status',
|
|
29
30
|
...props,
|
|
30
31
|
children: [image ? /*#__PURE__*/_jsx("div", {
|
|
31
32
|
className: `${baseClassName}__image`,
|