@plesk/ui-library 3.44.0 → 3.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/cjs/components/Action/Action.js +0 -6
  2. package/cjs/components/Alert/Alert.js +5 -1
  3. package/cjs/components/Button/Button.js +2 -0
  4. package/cjs/components/Carousel/Carousel.js +9 -4
  5. package/cjs/components/ComboBox/ComboBox.js +3 -0
  6. package/cjs/components/ComboBoxDropdown/ComboBoxDropdown.js +6 -2
  7. package/cjs/components/ComboBoxDropdown/index.js +6 -0
  8. package/cjs/components/Dialog/Dialog.js +3 -0
  9. package/cjs/components/Drawer/Header.js +5 -0
  10. package/cjs/components/Dropdown/Dropdown.js +3 -0
  11. package/cjs/components/Form/Form.js +3 -1
  12. package/cjs/components/FormField/FormField.js +9 -5
  13. package/cjs/components/FormFieldPassword/FormFieldPassword.js +9 -11
  14. package/cjs/components/InPlaceEdit/Editor.js +6 -7
  15. package/cjs/components/InPlaceEdit/InPlaceEdit.js +4 -4
  16. package/cjs/components/InputFile/InputFile.js +4 -4
  17. package/cjs/components/InputNumber/InputNumber.js +4 -0
  18. package/cjs/components/Layout/Layout.js +8 -0
  19. package/cjs/components/List/List.js +11 -6
  20. package/cjs/components/List/ListActions.js +5 -0
  21. package/cjs/components/LocaleProvider/LocaleProvider.js +13 -3
  22. package/cjs/components/Menu/MenuItem.js +4 -0
  23. package/cjs/components/Overlay/Overlay.js +1 -0
  24. package/cjs/components/Panel/Panel.js +3 -0
  25. package/cjs/components/Popover/Popover.js +3 -0
  26. package/cjs/components/Section/Section.js +4 -0
  27. package/cjs/components/Select/Select.js +12 -1
  28. package/cjs/components/Select/SelectControl.js +24 -7
  29. package/cjs/components/Spinner/Spinner.js +1 -0
  30. package/cjs/components/SwitchesPanelItem/SwitchesPanelItem.js +3 -0
  31. package/cjs/components/Tabs/SearchBar.js +7 -0
  32. package/cjs/components/Tabs/TabClose.js +3 -0
  33. package/cjs/components/Toast/Toast.js +3 -0
  34. package/cjs/components/Tooltip/Tooltip.js +92 -202
  35. package/cjs/components/Tooltip/TooltipContent.js +83 -0
  36. package/cjs/components/Tooltip/getA11yAttributes.js +30 -0
  37. package/cjs/components/Tooltip/useVirtualElement.js +35 -0
  38. package/cjs/components/utils.js +42 -2
  39. package/cjs/hooks/useEscapeKeydown.js +25 -0
  40. package/cjs/index.js +1 -1
  41. package/cjs/locales/ar.js +66 -4
  42. package/cjs/locales/ca-ES.js +66 -4
  43. package/cjs/locales/cs-CZ.js +66 -4
  44. package/cjs/locales/da-DK.js +66 -4
  45. package/cjs/locales/de-DE.js +66 -4
  46. package/cjs/locales/el-GR.js +66 -4
  47. package/cjs/locales/en-US.js +66 -4
  48. package/cjs/locales/es-ES.js +66 -4
  49. package/cjs/locales/fi-FI.js +66 -4
  50. package/cjs/locales/fr-FR.js +66 -4
  51. package/cjs/locales/he-IL.js +66 -4
  52. package/cjs/locales/hu-HU.js +66 -4
  53. package/cjs/locales/id-ID.js +66 -4
  54. package/cjs/locales/it-IT.js +66 -4
  55. package/cjs/locales/ja-JP.js +66 -4
  56. package/cjs/locales/ko-KR.js +66 -4
  57. package/cjs/locales/ms-MY.js +66 -4
  58. package/cjs/locales/nb-NO.js +66 -4
  59. package/cjs/locales/nl-NL.js +66 -4
  60. package/cjs/locales/pl-PL.js +66 -4
  61. package/cjs/locales/pt-BR.js +66 -4
  62. package/cjs/locales/pt-PT.js +66 -4
  63. package/cjs/locales/ro-RO.js +66 -4
  64. package/cjs/locales/ru-RU.js +66 -4
  65. package/cjs/locales/sv-SE.js +66 -4
  66. package/cjs/locales/th-TH.js +66 -4
  67. package/cjs/locales/tl-PH.js +66 -4
  68. package/cjs/locales/tr-TR.js +66 -4
  69. package/cjs/locales/uk-UA.js +66 -4
  70. package/cjs/locales/vi-VN.js +66 -4
  71. package/cjs/locales/zh-CN.js +66 -4
  72. package/cjs/locales/zh-TW.js +66 -4
  73. package/cjs/utils.js +2 -17
  74. package/dist/plesk-ui-library-rtl.css +1 -1
  75. package/dist/plesk-ui-library-rtl.css.map +1 -1
  76. package/dist/plesk-ui-library.css +1 -1
  77. package/dist/plesk-ui-library.css.map +1 -1
  78. package/dist/plesk-ui-library.js +7632 -3008
  79. package/dist/plesk-ui-library.js.map +1 -1
  80. package/dist/plesk-ui-library.min.js +6 -6
  81. package/dist/plesk-ui-library.min.js.map +1 -1
  82. package/esm/components/Action/Action.js +0 -6
  83. package/esm/components/Alert/Alert.js +5 -1
  84. package/esm/components/Button/Button.js +2 -0
  85. package/esm/components/Carousel/Carousel.js +9 -4
  86. package/esm/components/ComboBox/ComboBox.js +3 -0
  87. package/esm/components/ComboBoxDropdown/ComboBoxDropdown.js +4 -1
  88. package/esm/components/ComboBoxDropdown/index.js +1 -1
  89. package/esm/components/Dialog/Dialog.js +3 -0
  90. package/esm/components/Drawer/Header.js +5 -0
  91. package/esm/components/Dropdown/Dropdown.js +3 -0
  92. package/esm/components/Form/Form.js +3 -1
  93. package/esm/components/FormField/FormField.js +9 -5
  94. package/esm/components/FormFieldPassword/FormFieldPassword.js +9 -11
  95. package/esm/components/InPlaceEdit/Editor.js +6 -7
  96. package/esm/components/InPlaceEdit/InPlaceEdit.js +4 -4
  97. package/esm/components/InputFile/InputFile.js +4 -4
  98. package/esm/components/InputNumber/InputNumber.js +4 -0
  99. package/esm/components/Layout/Layout.js +8 -0
  100. package/esm/components/List/List.js +11 -6
  101. package/esm/components/List/ListActions.js +5 -0
  102. package/esm/components/LocaleProvider/LocaleProvider.js +11 -2
  103. package/esm/components/Menu/MenuItem.js +5 -1
  104. package/esm/components/Overlay/Overlay.js +2 -1
  105. package/esm/components/Panel/Panel.js +3 -0
  106. package/esm/components/Popover/Popover.js +3 -0
  107. package/esm/components/Section/Section.js +4 -0
  108. package/esm/components/Select/Select.js +13 -2
  109. package/esm/components/Select/SelectControl.js +24 -7
  110. package/esm/components/Spinner/Spinner.js +1 -0
  111. package/esm/components/SwitchesPanelItem/SwitchesPanelItem.js +3 -0
  112. package/esm/components/Tabs/SearchBar.js +7 -0
  113. package/esm/components/Tabs/TabClose.js +3 -0
  114. package/esm/components/Toast/Toast.js +3 -0
  115. package/esm/components/Tooltip/Tooltip.js +94 -204
  116. package/esm/components/Tooltip/TooltipContent.js +75 -0
  117. package/esm/components/Tooltip/getA11yAttributes.js +23 -0
  118. package/esm/components/Tooltip/useVirtualElement.js +28 -0
  119. package/esm/components/utils.js +37 -1
  120. package/esm/hooks/useEscapeKeydown.js +18 -0
  121. package/esm/index.js +1 -1
  122. package/esm/locales/ar.js +66 -4
  123. package/esm/locales/ca-ES.js +66 -4
  124. package/esm/locales/cs-CZ.js +66 -4
  125. package/esm/locales/da-DK.js +66 -4
  126. package/esm/locales/de-DE.js +66 -4
  127. package/esm/locales/el-GR.js +66 -4
  128. package/esm/locales/en-US.js +66 -4
  129. package/esm/locales/es-ES.js +66 -4
  130. package/esm/locales/fi-FI.js +66 -4
  131. package/esm/locales/fr-FR.js +66 -4
  132. package/esm/locales/he-IL.js +66 -4
  133. package/esm/locales/hu-HU.js +66 -4
  134. package/esm/locales/id-ID.js +66 -4
  135. package/esm/locales/it-IT.js +66 -4
  136. package/esm/locales/ja-JP.js +66 -4
  137. package/esm/locales/ko-KR.js +66 -4
  138. package/esm/locales/ms-MY.js +66 -4
  139. package/esm/locales/nb-NO.js +66 -4
  140. package/esm/locales/nl-NL.js +66 -4
  141. package/esm/locales/pl-PL.js +66 -4
  142. package/esm/locales/pt-BR.js +66 -4
  143. package/esm/locales/pt-PT.js +66 -4
  144. package/esm/locales/ro-RO.js +66 -4
  145. package/esm/locales/ru-RU.js +66 -4
  146. package/esm/locales/sv-SE.js +66 -4
  147. package/esm/locales/th-TH.js +66 -4
  148. package/esm/locales/tl-PH.js +66 -4
  149. package/esm/locales/tr-TR.js +66 -4
  150. package/esm/locales/uk-UA.js +66 -4
  151. package/esm/locales/vi-VN.js +66 -4
  152. package/esm/locales/zh-CN.js +66 -4
  153. package/esm/locales/zh-TW.js +66 -4
  154. package/esm/utils.js +0 -14
  155. package/package.json +7 -6
  156. package/styleguide/build/bundle.1771d6b7.js +2 -0
  157. package/styleguide/index.html +2 -2
  158. package/types/components/Button/Button.d.ts +6 -0
  159. package/types/components/ComboBoxDropdown/ComboBoxDropdown.d.ts +1 -0
  160. package/types/components/ComboBoxDropdown/index.d.ts +1 -1
  161. package/types/components/Dropdown/Dropdown.d.ts +5 -0
  162. package/types/components/Layout/Layout.d.ts +1 -0
  163. package/types/components/List/ListActions.d.ts +6 -1
  164. package/types/components/LocaleProvider/LocaleProvider.d.ts +3 -0
  165. package/types/components/Select/Select.d.ts +4 -0
  166. package/types/components/Select/SelectControl.d.ts +4 -0
  167. package/types/components/Tooltip/Tooltip.d.ts +15 -26
  168. package/types/components/Tooltip/TooltipContent.d.ts +11 -0
  169. package/types/components/Tooltip/getA11yAttributes.d.ts +19 -0
  170. package/types/components/Tooltip/useVirtualElement.d.ts +3 -0
  171. package/types/components/utils.d.ts +8 -1
  172. package/types/hooks/useEscapeKeydown.d.ts +1 -0
  173. package/types/utils.d.ts +0 -3
  174. package/styleguide/build/bundle.cf3363eb.js +0 -2
  175. /package/styleguide/build/{bundle.cf3363eb.js.LICENSE.txt → bundle.1771d6b7.js.LICENSE.txt} +0 -0
@@ -6,7 +6,6 @@ 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';
10
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
10
  /**
12
11
  * `Action` component is used mostly for navigation, to go between pages, and not for immediate action or submitting data.
@@ -69,11 +68,6 @@ const Action = _ref => {
69
68
  });
70
69
  }
71
70
  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
- }
77
71
  return /*#__PURE__*/_jsxs(RootTag, {
78
72
  className: classNames(baseClassName, {
79
73
  [`${baseClassName}--size-${size}`]: icon || progress,
@@ -2,6 +2,7 @@
2
2
 
3
3
  import classNames from 'classnames';
4
4
  import { CLS_PREFIX } from '../../constants';
5
+ import { useInternalTranslate } from '../LocaleProvider';
5
6
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
7
  /**
7
8
  * `Alert` component is used for highlighting important content.
@@ -18,13 +19,16 @@ const Alert = _ref => {
18
19
  onClose,
19
20
  ...props
20
21
  } = _ref;
22
+ const translate = useInternalTranslate('Alert');
21
23
  return /*#__PURE__*/_jsxs("div", {
22
24
  className: classNames(baseClassName, {
23
25
  [`${baseClassName}--${intent}`]: intent
24
26
  }, className),
25
27
  role: intent === 'warning' || intent === 'danger' ? 'alert' : 'status',
26
28
  ...props,
27
- children: [onClose && /*#__PURE__*/_jsx("span", {
29
+ children: [onClose && /*#__PURE__*/_jsx("button", {
30
+ "aria-label": translate('close'),
31
+ type: "button",
28
32
  className: "close",
29
33
  onClick: onClose
30
34
  }), children]
@@ -81,6 +81,7 @@ const Button = /*#__PURE__*/forwardRef((_ref3, ref) => {
81
81
  caret,
82
82
  fill = false,
83
83
  tooltip,
84
+ tooltipAsLabel,
84
85
  children,
85
86
  arrow,
86
87
  disabled = false,
@@ -173,6 +174,7 @@ const Button = /*#__PURE__*/forwardRef((_ref3, ref) => {
173
174
  if (tooltipElement) {
174
175
  button = /*#__PURE__*/_jsx(Tooltip, {
175
176
  title: tooltipElement,
177
+ asLabel: tooltipAsLabel,
176
178
  children: button
177
179
  });
178
180
  }
@@ -7,6 +7,7 @@ import classNames from 'classnames';
7
7
  import Measure from 'react-measure';
8
8
  import { CLS_PREFIX } from '../../constants';
9
9
  import Icon from '../Icon';
10
+ import { getInternalTranslate } from '../LocaleProvider';
10
11
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
12
  const calcWidths = node => {
12
13
  const slideWidths = [].map.call(node.childNodes, el => el.getBoundingClientRect().width);
@@ -16,6 +17,7 @@ const calcWidths = node => {
16
17
  totalWidth
17
18
  };
18
19
  };
20
+ const translate = getInternalTranslate('Carousel');
19
21
  /**
20
22
  * Carousel component is used for optimizing page space by displaying only some parts
21
23
  * of entire content in a cyclic view.
@@ -104,9 +106,12 @@ class Carousel extends Component {
104
106
  className: `${baseClassName}__dots`,
105
107
  children: Array.from({
106
108
  length: childrenCount
107
- }).map((_, idx) => /*#__PURE__*/_jsx("div", {
108
- role: "button",
109
+ }).map((_, idx) => /*#__PURE__*/_jsx("button", {
110
+ type: "button",
109
111
  className: classNames(`${baseClassName}__dot`, current === idx ? `${baseClassName}__dot--current` : null),
112
+ "aria-label": translate('viewSlide', {
113
+ slideNumber: idx + 1
114
+ }),
110
115
  "aria-current": current === idx,
111
116
  onClick: () => this.setCurrentSlide(idx)
112
117
  // eslint-disable-next-line react/no-array-index-key
@@ -132,7 +137,7 @@ class Carousel extends Component {
132
137
  className: `${baseClassName}__controls`,
133
138
  children: [/*#__PURE__*/_jsx("button", {
134
139
  type: "button",
135
- "aria-label": "previous slide",
140
+ "aria-label": translate('previousSlide'),
136
141
  className: classNames(`${baseClassName}__control`, `${baseClassName}__control--previous`),
137
142
  onClick: this.handlePrevClick,
138
143
  children: /*#__PURE__*/_jsx(Icon, {
@@ -142,7 +147,7 @@ class Carousel extends Component {
142
147
  })
143
148
  }), /*#__PURE__*/_jsx("button", {
144
149
  type: "button",
145
- "aria-label": "next slide",
150
+ "aria-label": translate('nextSlide'),
146
151
  className: classNames(`${baseClassName}__control`, `${baseClassName}__control--next`),
147
152
  onClick: this.handleNextClick,
148
153
  children: /*#__PURE__*/_jsx(Icon, {
@@ -8,6 +8,7 @@ import Input from '../Input';
8
8
  import Icon from '../Icon';
9
9
  import ComboBoxDropdown, { findNextSafeIndex } from '../ComboBoxDropdown';
10
10
  import ComboBoxOption from './ComboBoxOption';
11
+ import { useInternalTranslate } from '../LocaleProvider';
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
  const collect = function (children) {
13
14
  let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
@@ -54,6 +55,7 @@ const ComboBox = _ref => {
54
55
  children,
55
56
  ...props
56
57
  } = _ref;
58
+ const translate = useInternalTranslate('ComboBox');
57
59
  const [opened, setOpened] = useState(false);
58
60
  const [highlightedIndex, setHighlightedIndex] = useState(-1);
59
61
  const inputRef = useRef(null);
@@ -135,6 +137,7 @@ const ComboBox = _ref => {
135
137
  }
136
138
  };
137
139
  const button = /*#__PURE__*/_jsx("button", {
140
+ "aria-label": translate(opened ? 'close' : 'open'),
138
141
  className: `${baseClassName}__dropdown-button`,
139
142
  onClick: handleToggle,
140
143
  onMouseDown: e => e.preventDefault(),
@@ -24,6 +24,7 @@ export const findNextSafeIndex = (currIndex, diff, options) => {
24
24
  }
25
25
  return -1;
26
26
  };
27
+ export const getOptionId = (listboxId, index) => `${listboxId}-option-${index}`;
27
28
  const ComboBoxDropdown = _ref => {
28
29
  let {
29
30
  baseClassName = `${CLS_PREFIX}combobox-dropdown`,
@@ -140,6 +141,7 @@ const ComboBoxDropdown = _ref => {
140
141
  };
141
142
  }
142
143
  const menuItemProps = {
144
+ id: listboxId ? getOptionId(listboxId, optionIndex) : undefined,
143
145
  ...option.props,
144
146
  active: value === option.value,
145
147
  className: classNames(`${baseClassName}__option`, {
@@ -149,7 +151,8 @@ const ComboBoxDropdown = _ref => {
149
151
  onClick,
150
152
  onMouseOver,
151
153
  onMouseDown,
152
- 'data-index': optionIndex
154
+ 'data-index': optionIndex,
155
+ 'aria-selected': value === option.value
153
156
  };
154
157
  acc.push(/*#__PURE__*/_jsx(MenuItem, {
155
158
  ...menuItemProps,
@@ -1,3 +1,3 @@
1
1
  // Copyright 1999-2025. WebPros International GmbH. All rights reserved.
2
2
 
3
- export { default, findNextSafeIndex } from './ComboBoxDropdown';
3
+ export { default, findNextSafeIndex, getOptionId } from './ComboBoxDropdown';
@@ -11,6 +11,7 @@ import Heading from '../Heading';
11
11
  import Text from '../Text';
12
12
  import { isLikeText, InternalTranslate } from '../Translate';
13
13
  import { safeInvoke } from '../utils';
14
+ import { useInternalTranslate } from '../LocaleProvider';
14
15
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
16
  const isProps = value => value && typeof value === 'object' && ! /*#__PURE__*/isValidElement(value);
16
17
 
@@ -40,6 +41,7 @@ const Dialog = _ref => {
40
41
  closingConfirmation,
41
42
  ...props
42
43
  } = _ref;
44
+ const translate = useInternalTranslate('Dialog');
43
45
  const [isVisible, setIsVisible] = useState(isOpen);
44
46
  const {
45
47
  onCloseWithConfirmation,
@@ -187,6 +189,7 @@ const Dialog = _ref => {
187
189
  }), (actions || closable) && /*#__PURE__*/_jsxs("div", {
188
190
  className: `${baseClassName}__header-actions`,
189
191
  children: [actions, closable && /*#__PURE__*/_jsx(Button, {
192
+ "aria-label": translate('closeButton'),
190
193
  className: `${baseClassName}__header-close`,
191
194
  disabled: !canClose,
192
195
  ghost: true,
@@ -5,6 +5,7 @@ import classNames from 'classnames';
5
5
  import { CLS_PREFIX } from '../../constants';
6
6
  import Button from '../Button';
7
7
  import Icon from '../Icon';
8
+ import { useInternalTranslate } from '../LocaleProvider';
8
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
10
  const Header = _ref => {
10
11
  let {
@@ -16,8 +17,10 @@ const Header = _ref => {
16
17
  tabs,
17
18
  ...props
18
19
  } = _ref;
20
+ const translate = useInternalTranslate('Drawer');
19
21
  const renderBackButton = () => /*#__PURE__*/_jsx(Button, {
20
22
  ghost: true,
23
+ "aria-label": translate('backButton'),
21
24
  className: classNames(`${baseClassName}__button`, `${baseClassName}__button--back`),
22
25
  size: "lg",
23
26
  icon: /*#__PURE__*/_jsx(Icon, {
@@ -29,6 +32,7 @@ const Header = _ref => {
29
32
  });
30
33
  const renderHideButton = () => /*#__PURE__*/_jsx(Button, {
31
34
  ghost: true,
35
+ "aria-label": translate('hideButton'),
32
36
  className: classNames(`${baseClassName}__button`, `${baseClassName}__button--hide`),
33
37
  size: "lg",
34
38
  icon: /*#__PURE__*/_jsx(Icon, {
@@ -43,6 +47,7 @@ const Header = _ref => {
43
47
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
44
48
  return /*#__PURE__*/_jsx(Button, {
45
49
  ghost: true,
50
+ "aria-label": translate('closeButton'),
46
51
  className: classNames(`${baseClassName}__button`, `${baseClassName}__button--close`),
47
52
  size: "lg",
48
53
  icon: /*#__PURE__*/_jsx(Icon, {
@@ -133,6 +133,7 @@ const Dropdown = _ref3 => {
133
133
  menuPlacement = 'bottom-start',
134
134
  overlay = false,
135
135
  locale,
136
+ onToggle,
136
137
  ...props
137
138
  } = _ref3;
138
139
  const [opened, setOpened] = useState(false);
@@ -144,10 +145,12 @@ const Dropdown = _ref3 => {
144
145
  const handleOpen = isKeyboardEvent => {
145
146
  setAutoFocus(isKeyboardEvent);
146
147
  setOpened(true);
148
+ onToggle?.(true);
147
149
  };
148
150
  const handleClose = () => {
149
151
  closeTimerRef.current = setTimeout(() => {
150
152
  setOpened(false);
153
+ onToggle?.(false);
151
154
  }, 0);
152
155
  };
153
156
  const {
@@ -177,7 +177,9 @@ class Form extends Component {
177
177
  height: 0,
178
178
  width: 0,
179
179
  position: 'absolute'
180
- }
180
+ },
181
+ "aria-hidden": "true",
182
+ tabIndex: -1
181
183
  })]
182
184
  });
183
185
  }
@@ -19,7 +19,9 @@ import SectionContext from '../Section/SectionContext';
19
19
  import VerticalContext from '../VerticalContext';
20
20
  import ScrollableElementFormContext from '../Form/ScrollableElementFormContext';
21
21
  import DisabledContext from '../Form/DisabledContext';
22
+ import { getInternalTranslate } from '../LocaleProvider';
22
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
+ const translate = getInternalTranslate('FormField');
23
25
  export const BASE_FORM_FIELD_CLASS_NAME = `${CLS_PREFIX}form-field`;
24
26
  const defaultValue = undefined;
25
27
 
@@ -163,8 +165,8 @@ class FormField extends Component {
163
165
  _defineProperty(this, "renderRemoveButton", index => {
164
166
  const {
165
167
  multi,
166
- locale,
167
- disabled
168
+ disabled,
169
+ locale
168
170
  } = this.props;
169
171
  const value = getArrayHelper(this.fieldApi.getValue());
170
172
  const isClearable = multi && value.length === 1 && !isEmpty(value[0]);
@@ -174,11 +176,12 @@ class FormField extends Component {
174
176
  return /*#__PURE__*/_jsx(Button, {
175
177
  className: `${this.props.baseClassName}__remove`,
176
178
  icon: isClearable ? 'clean' : 'cross-mark',
177
- tooltip: /*#__PURE__*/_jsx(InternalTranslate, {
179
+ tooltip: locale ? /*#__PURE__*/_jsx(InternalTranslate, {
178
180
  namespace: "FormField",
179
181
  content: isClearable ? 'clear' : 'remove',
180
182
  translators: locale
181
- }),
183
+ }) : translate(isClearable ? 'clear' : 'remove'),
184
+ tooltipAsLabel: true,
182
185
  onClick: () => this.handleRemove(index),
183
186
  disabled: disabled,
184
187
  ghost: true
@@ -266,7 +269,7 @@ class FormField extends Component {
266
269
  ref: _this.setTargetRef(index),
267
270
  children: innerField
268
271
  }), hasErrors && Object.keys(fieldErrors).map(key => /*#__PURE__*/_jsxs("span", {
269
- id: fieldId ? `${id}-${key}` : undefined,
272
+ id: fieldId ? `${fieldId}-${key}` : undefined,
270
273
  className: `${baseClassName}__error`,
271
274
  children: [/*#__PURE__*/_jsx(Icon, {
272
275
  className: `${baseClassName}__error-icon`,
@@ -312,6 +315,7 @@ class FormField extends Component {
312
315
  }
313
316
  return /*#__PURE__*/_jsx(Popover, {
314
317
  target: /*#__PURE__*/_jsx(Action, {
318
+ "aria-label": translate('showDescription'),
315
319
  outerProps: {
316
320
  className: `${this.props.baseClassName}__full-description`
317
321
  },
@@ -12,7 +12,10 @@ import { InternalTranslate } from '../Translate';
12
12
  import PasswordMeter from './PasswordMeter';
13
13
  import generatePassword from './generatePassword';
14
14
  import { copyToClipboard } from '../../utils';
15
+ import { getInternalTranslate } from '../LocaleProvider';
15
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
+ const translate = getInternalTranslate('FormFieldPassword');
18
+
16
19
  /**
17
20
  * `FormFieldPassword` component provides secure way to enter a password.
18
21
  * @since 0.0.58
@@ -63,9 +66,8 @@ class FormFieldPassword extends Component {
63
66
  className: `${baseClassName}__button--copy`,
64
67
  icon: 'copy',
65
68
  onClick: () => this.handleCopyToClipboard(value),
66
- tooltip: /*#__PURE__*/_jsx(InternalTranslate, {
67
- content: "FormFieldPassword.copyButtonHint"
68
- }),
69
+ tooltip: translate('copyButtonHint'),
70
+ tooltipAsLabel: true,
69
71
  disabled: isDisabled()
70
72
  };
71
73
  let button;
@@ -97,9 +99,8 @@ class FormFieldPassword extends Component {
97
99
  passwordGenerated: true
98
100
  });
99
101
  },
100
- tooltip: /*#__PURE__*/_jsx(InternalTranslate, {
101
- content: "FormFieldPassword.generateButtonHint"
102
- }),
102
+ tooltip: translate('generateButtonHint'),
103
+ tooltipAsLabel: true,
103
104
  disabled: isDisabled(),
104
105
  children: /*#__PURE__*/_jsx(InternalTranslate, {
105
106
  content: "FormFieldPassword.generateButton"
@@ -173,11 +174,8 @@ class FormFieldPassword extends Component {
173
174
  className: `${baseClassName}__button--show`,
174
175
  onClick: this.handleToggleClick,
175
176
  icon: visible ? 'visible' : 'invisible',
176
- tooltip: visible ? /*#__PURE__*/_jsx(InternalTranslate, {
177
- content: "FormFieldPassword.hidePassword"
178
- }) : /*#__PURE__*/_jsx(InternalTranslate, {
179
- content: "FormFieldPassword.showPassword"
180
- }),
177
+ tooltip: translate(visible ? 'hidePassword' : 'showPassword'),
178
+ tooltipAsLabel: true,
181
179
  ghost: true,
182
180
  disabled: isDisabled()
183
181
  }),
@@ -4,7 +4,7 @@ import { useState } from 'react';
4
4
  import classNames from 'classnames';
5
5
  import Button from '../Button';
6
6
  import Input from '../Input';
7
- import { InternalTranslate } from '../Translate';
7
+ import { useInternalTranslate } from '../LocaleProvider';
8
8
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
9
  const Editor = _ref => {
10
10
  let {
@@ -13,6 +13,7 @@ const Editor = _ref => {
13
13
  onCancel,
14
14
  baseClassName
15
15
  } = _ref;
16
+ const translate = useInternalTranslate('InPlaceEdit');
16
17
  const [value, setValue] = useState(initialValue);
17
18
  const handleChange = event => {
18
19
  setValue(event.target.value);
@@ -40,17 +41,15 @@ const Editor = _ref => {
40
41
  className: classNames(`${baseClassName}__control-button`, `${baseClassName}__control-button--ok`),
41
42
  icon: "check-mark",
42
43
  onClick: handleSave,
43
- tooltip: /*#__PURE__*/_jsx(InternalTranslate, {
44
- content: "InPlaceEdit.okButtonHint"
45
- })
44
+ tooltip: translate('okButtonHint'),
45
+ tooltipAsLabel: true
46
46
  }), /*#__PURE__*/_jsx(Button, {
47
47
  ghost: true,
48
48
  className: classNames(`${baseClassName}__control-button`, `${baseClassName}__control-button--cancel`),
49
49
  icon: "cross-mark",
50
50
  onClick: onCancel,
51
- tooltip: /*#__PURE__*/_jsx(InternalTranslate, {
52
- content: "InPlaceEdit.cancelButtonHint"
53
- })
51
+ tooltip: translate('cancelButtonHint'),
52
+ tooltipAsLabel: true
54
53
  })]
55
54
  })]
56
55
  });
@@ -4,8 +4,8 @@ import { useState } from 'react';
4
4
  import classNames from 'classnames';
5
5
  import { CLS_PREFIX } from '../../constants';
6
6
  import Button from '../Button';
7
- import { InternalTranslate } from '../Translate';
8
7
  import Editor from './Editor';
8
+ import { useInternalTranslate } from '../LocaleProvider';
9
9
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
10
  /**
11
11
  * This component allows users to edit a short text "in place" — in other words, straight in the interface, without
@@ -21,6 +21,7 @@ const InPlaceEdit = _ref => {
21
21
  value,
22
22
  ...props
23
23
  } = _ref;
24
+ const translate = useInternalTranslate('InPlaceEdit');
24
25
  const [isEditing, setIsEditing] = useState(false);
25
26
  const toggleEditing = () => setIsEditing(current => !current);
26
27
  const handleSave = newValue => {
@@ -38,9 +39,8 @@ const InPlaceEdit = _ref => {
38
39
  name: 'pencil',
39
40
  className: `${baseClassName}__control-button-icon`
40
41
  },
41
- tooltip: /*#__PURE__*/_jsx(InternalTranslate, {
42
- content: "InPlaceEdit.editButtonHint"
43
- })
42
+ tooltip: translate('editButtonHint'),
43
+ tooltipAsLabel: true
44
44
  }), isEditing && /*#__PURE__*/_jsx(Editor, {
45
45
  baseClassName: baseClassName,
46
46
  value: `${value}`,
@@ -62,7 +62,7 @@ const InputFile = _ref => {
62
62
  ...props,
63
63
  children: [/*#__PURE__*/_jsxs(Button, {
64
64
  className: `${baseClassName}__button`,
65
- "data-testId": testId && `${testId}--browse-button`,
65
+ "data-testid": testId && `${testId}--browse-button`,
66
66
  disabled: disabled,
67
67
  component: "label",
68
68
  state: hasFocus ? 'focused' : undefined,
@@ -73,7 +73,7 @@ const InputFile = _ref => {
73
73
  onChange: handleChange,
74
74
  className: `${baseClassName}__input`,
75
75
  ref: inputRef,
76
- "data-testId": testId && `${testId}--file-input`,
76
+ "data-testid": testId && `${testId}--file-input`,
77
77
  onFocus: handleFocus,
78
78
  onBlur: handleBlur,
79
79
  accept: accept
@@ -87,14 +87,14 @@ const InputFile = _ref => {
87
87
  truncate: true,
88
88
  nowrap: true,
89
89
  className: `${baseClassName}__name`,
90
- "data-testId": testId && `${testId}--file-name`,
90
+ "data-testid": testId && `${testId}--file-name`,
91
91
  intent: disabled ? 'muted' : undefined,
92
92
  children: file.name
93
93
  }), /*#__PURE__*/_jsx(Button, {
94
94
  icon: "cross-mark",
95
95
  ghost: true,
96
96
  onClick: handleReset,
97
- "data-testId": testId && `${testId}--reset-button`,
97
+ "data-testid": testId && `${testId}--reset-button`,
98
98
  disabled: disabled
99
99
  })]
100
100
  })]
@@ -6,6 +6,7 @@ import { safeInvoke } from '../utils';
6
6
  import Input from '../Input';
7
7
  import Button from '../Button';
8
8
  import { CLS_PREFIX } from '../../constants';
9
+ import { useInternalTranslate } from '../LocaleProvider';
9
10
  import { jsx as _jsx } from "react/jsx-runtime";
10
11
  const fitToMinMax = function (value) {
11
12
  let min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MIN_SAFE_INTEGER || -(Math.pow(2, 53) - 1);
@@ -57,6 +58,7 @@ const InputNumber = _ref => {
57
58
  incrementIcon = 'plus',
58
59
  ...props
59
60
  } = _ref;
61
+ const translate = useInternalTranslate('InputNumber');
60
62
  const inputRef = useRef(null);
61
63
  const isControlled = propValue !== undefined;
62
64
  const safeDefaultValue = typeof defaultValue === 'number' ? defaultValue : '';
@@ -141,6 +143,7 @@ const InputNumber = _ref => {
141
143
  className: classNames(baseClassName, className),
142
144
  innerRef: inputRef,
143
145
  prefix: /*#__PURE__*/_jsx(Button, {
146
+ "aria-label": translate('decrement'),
144
147
  icon: decrementIcon,
145
148
  ghost: true,
146
149
  disabled: minDisabled,
@@ -149,6 +152,7 @@ const InputNumber = _ref => {
149
152
  className: `${baseClassName}__dec`
150
153
  }),
151
154
  suffix: /*#__PURE__*/_jsx(Button, {
155
+ "aria-label": translate('increment'),
152
156
  icon: incrementIcon,
153
157
  ghost: true,
154
158
  disabled: maxDisabled,
@@ -5,8 +5,10 @@ import { Component, createRef } from 'react';
5
5
  import Measure from 'react-measure';
6
6
  import classNames from 'classnames';
7
7
  import { CSSTransition } from 'react-transition-group';
8
+ import { getInternalTranslate } from '../LocaleProvider';
8
9
  import { CLS_PREFIX } from '../../constants';
9
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ const translate = getInternalTranslate('Layout');
10
12
  const subscribeMatchMedia = (query, handler) => {
11
13
  const mq = window.matchMedia(query);
12
14
  handler(mq);
@@ -97,6 +99,10 @@ export default class Layout extends Component {
97
99
  } = this.state;
98
100
  return isResponsive ? isSidebarClosedResponsive : isSidebarClosedDesktop;
99
101
  });
102
+ _defineProperty(this, "getSidebarTogglerLabel", () => {
103
+ const isSidebarClosed = this.getSidebarClosed();
104
+ return translate(isSidebarClosed ? 'openSidebar' : 'closeSidebar');
105
+ });
100
106
  }
101
107
  static getDerivedStateFromProps(props, state) {
102
108
  const {
@@ -181,6 +187,7 @@ export default class Layout extends Component {
181
187
  type: "button",
182
188
  onClick: this.handleToggle,
183
189
  ref: this.responsiveSidebarTogglerRef,
190
+ "aria-label": this.getSidebarTogglerLabel(),
184
191
  children: /*#__PURE__*/_jsx("span", {
185
192
  className: `${baseClassName}__responsive-sidebar-toggler-inner`,
186
193
  children: /*#__PURE__*/_jsx("span", {
@@ -276,6 +283,7 @@ export default class Layout extends Component {
276
283
  className: `${baseClassName}__sidebar-toggler`,
277
284
  onClick: this.handleToggle,
278
285
  type: "button",
286
+ "aria-label": this.getSidebarTogglerLabel(),
279
287
  children: /*#__PURE__*/_jsx("span", {
280
288
  className: `${baseClassName}__sidebar-toggler-inner`
281
289
  })
@@ -22,7 +22,10 @@ import Columns, { Column } from '../Columns';
22
22
  import { FocusVisibleManager, useFocusVisible } from 'use-focus-visible';
23
23
  import Menu, { MenuItem } from '../Menu';
24
24
  import Label from '../Label';
25
+ import { getInternalTranslate } from '../LocaleProvider';
25
26
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
27
+ const translate = getInternalTranslate('List');
28
+
26
29
  // eslint-disable-next-line func-style
27
30
  function getRowKey(row, props) {
28
31
  const {
@@ -598,7 +601,6 @@ class List extends Component {
598
601
  ...(Wrapper === Tbody && !isDragged ? reorderableProps : undefined),
599
602
  key: getRowKey(row, this.props)
600
603
  }, /*#__PURE__*/_jsx("tr", {
601
- role: "listitem",
602
604
  className: classNames({
603
605
  'is-selected': this.isRowSelected(row),
604
606
  [`${baseClassName}__row--expanded`]: this.isRowExpanded(row),
@@ -722,7 +724,6 @@ class List extends Component {
722
724
  [`${baseClassName}--expandable`]: renderRowBody,
723
725
  [`${baseClassName}__table--vertical`]: vertical
724
726
  }),
725
- role: "list",
726
727
  children: element
727
728
  })
728
729
  });
@@ -770,7 +771,6 @@ class List extends Component {
770
771
  classNames: `${baseClassName}__row-body-`,
771
772
  nodeRef: trRef,
772
773
  children: state => /*#__PURE__*/_jsxs("tr", {
773
- role: "listitem",
774
774
  className: `${baseClassName}__row-body`,
775
775
  ref: trRef,
776
776
  children: [reorderable ? /*#__PURE__*/_jsx("td", {
@@ -1101,7 +1101,10 @@ class List extends Component {
1101
1101
  const headerCheckboxProps = {
1102
1102
  checked: headerChecked,
1103
1103
  indeterminate: onAllRowsSelectedChange && shouldBePagination ? this.state.selectAllActive : undefined,
1104
- onChange: onAllRowsSelectedChange && shouldBePagination ? () => this.toggleSelectionMenu() : this.handleGlobalSelectionChange
1104
+ onChange: onAllRowsSelectedChange && shouldBePagination ? () => this.toggleSelectionMenu() : this.handleGlobalSelectionChange,
1105
+ inputProps: {
1106
+ 'aria-label': translate('selectAllRows')
1107
+ }
1105
1108
  };
1106
1109
  let title = /*#__PURE__*/_jsx(Checkbox, {
1107
1110
  ...headerCheckboxProps
@@ -1136,7 +1139,8 @@ class List extends Component {
1136
1139
  disabled: row.disabled,
1137
1140
  onChange: checked => this.handleRowSelectionChange(checked, getRowKey(row, this.props)),
1138
1141
  inputProps: {
1139
- value: getRowKey(row, this.props)
1142
+ value: getRowKey(row, this.props),
1143
+ 'aria-label': translate('selectRow')
1140
1144
  }
1141
1145
  };
1142
1146
  if (typeof renderSelectionCheckbox === 'function') {
@@ -1158,6 +1162,7 @@ class List extends Component {
1158
1162
  },
1159
1163
  title: /*#__PURE__*/_jsx(Button, {
1160
1164
  ghost: true,
1165
+ "aria-label": translate('toggleAllRows'),
1161
1166
  className: `${baseClassName}__row-expander`,
1162
1167
  icon: /*#__PURE__*/_jsx(Icon, {
1163
1168
  className: `${baseClassName}__row-expander-icon`,
@@ -1177,6 +1182,7 @@ class List extends Component {
1177
1182
  }),
1178
1183
  render: row => this.isRowExpandable(row) && /*#__PURE__*/_jsx(Button, {
1179
1184
  ghost: true,
1185
+ "aria-label": translate('toggleRow'),
1180
1186
  className: `${baseClassName}__row-expander`,
1181
1187
  icon: /*#__PURE__*/_jsx(Icon, {
1182
1188
  className: `${baseClassName}__row-expander-icon`,
@@ -1239,7 +1245,6 @@ class List extends Component {
1239
1245
  [`${baseClassName}__table--vertical`]: vertical,
1240
1246
  [`${baseClassName}__table--reorderable`]: reorderable
1241
1247
  }),
1242
- role: "list",
1243
1248
  ...reorderableProps,
1244
1249
  children: [hasTitle && /*#__PURE__*/_jsx("thead", {
1245
1250
  children: /*#__PURE__*/_jsx("tr", {
@@ -8,6 +8,7 @@ import Dropdown from '../Dropdown';
8
8
  import Menu from '../Menu';
9
9
  import ListAction from './ListAction';
10
10
  import VerticalContext from '../VerticalContext';
11
+ import { useInternalTranslate } from '../LocaleProvider';
11
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
13
  /**
13
14
  * `ListActions` component is used for performing operations on individual objects in [List](#!/List).
@@ -19,8 +20,10 @@ const ListActions = _ref => {
19
20
  className,
20
21
  children,
21
22
  locale,
23
+ onMenuToggle,
22
24
  ...props
23
25
  } = _ref;
26
+ const translate = useInternalTranslate('ListActions');
24
27
  const [overlay, setOverlay] = useState(false);
25
28
  const vertical = useContext(VerticalContext);
26
29
  useEffect(() => {
@@ -75,7 +78,9 @@ const ListActions = _ref => {
75
78
  menuPlacement: "bottom-end",
76
79
  overlay: overlay,
77
80
  locale: locale,
81
+ onToggle: onMenuToggle,
78
82
  children: /*#__PURE__*/_jsx(Button, {
83
+ "aria-label": translate('menuButton'),
79
84
  ghost: true,
80
85
  icon: "kebab"
81
86
  })