@linagora/twake-mui 9.16.0 → 9.17.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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # @linagora/twake-mui [9.17.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.16.0...@linagora/twake-mui@9.17.0) (2026-10-05)
2
+
3
+
4
+ ### Features
5
+
6
+ * **twake-mui:** Translate SearchBar clear label in en, fr, ru and vi ([130409a](https://github.com/linagora/twake-ui/commit/130409a03794c3c776c447c671068128c09d8999))
7
+
1
8
  # @linagora/twake-mui [9.16.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.15.0...@linagora/twake-mui@9.16.0) (2026-10-01)
2
9
 
3
10
 
@@ -3,6 +3,7 @@ import { IconButton } from '@mui/material';
3
3
  import debounce from '@mui/utils/debounce';
4
4
  import cx from 'classnames';
5
5
  import React, { forwardRef, useState, useMemo, useRef, useEffect } from 'react';
6
+ import { useExtendI18n, useI18n } from 'twake-i18n';
6
7
  import { DisableHighlight } from './DisableHighlight';
7
8
  import { FocusHighlight } from './FocusHighlight';
8
9
  import { SearchBarButtonBase } from './SearchBarButtonBase';
@@ -10,7 +11,14 @@ import { SearchBarIconWrapper } from './SearchBarIconWrapper';
10
11
  import { SearchBarInputBase } from './SearchBarInputBase';
11
12
  import { SearchBarRoot } from './SearchBarRoot';
12
13
  import { SearchBarTypography } from './SearchBarTypography';
14
+ import en from './locales/en.json';
15
+ import fr from './locales/fr.json';
16
+ import ru from './locales/ru.json';
17
+ import vi from './locales/vi.json';
18
+ const locales = { en, fr, ru, vi };
13
19
  export const SearchBar = forwardRef(({ placeholder, icon = Magnifier, size = 'small', type = 'search', label, componentsProps, disabledClear = false, disabledFocus = false, disabledHover = false, className, defaultValue = '', value, elevation = 1, disabled = false, onChange = () => { }, onClear = () => { }, onFocus = () => { }, onBlur = () => { }, ...props }, ref) => {
20
+ useExtendI18n(locales);
21
+ const { t } = useI18n();
14
22
  const [currentValue, setCurrentValue] = useState(defaultValue);
15
23
  const [isFocused, setIsFocused] = useState(false);
16
24
  const spreadValue = typeof value !== 'undefined' ? value : currentValue;
@@ -78,7 +86,7 @@ export const SearchBar = forwardRef(({ placeholder, icon = Magnifier, size = 'sm
78
86
  icon && (React.createElement(SearchBarIconWrapper, { className: "SearchBar-icon" },
79
87
  React.createElement(Icon, { icon: icon }))),
80
88
  React.createElement(SearchBarInputBase, { ...componentsProps?.inputBase, className: cx(componentsProps?.inputBase?.className), searchSize: size, hasIcon: !!icon, placeholder: disabled ? undefined : placeholder, value: disabled ? placeholder : spreadValue, disabled: disabled, "aria-label": placeholder || 'Search', onChange: handleChange, onFocus: handleFocus, onBlur: handleBlur }))),
81
- spreadValue && !disabledClear && type === 'search' && !disabled && (React.createElement(IconButton, { size: "small", onClick: handleClear, "aria-label": "Clear search" },
89
+ spreadValue && !disabledClear && type === 'search' && !disabled && (React.createElement(IconButton, { size: "small", onClick: handleClear, "aria-label": t('SearchBar.clear') },
82
90
  React.createElement(Icon, { icon: Cross }))),
83
91
  !disabledHover && !disabled && (React.createElement(FocusHighlight, { className: "SearchBar-focusHighlight" })),
84
92
  disabled && (React.createElement(DisableHighlight, { className: "SearchBar-disableHighlight" }))));
@@ -0,0 +1,5 @@
1
+ {
2
+ "SearchBar": {
3
+ "clear": "Clear search"
4
+ }
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "SearchBar": {
3
+ "clear": "Effacer la recherche"
4
+ }
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "SearchBar": {
3
+ "clear": "Очистить поиск"
4
+ }
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "SearchBar": {
3
+ "clear": "Xóa tìm kiếm"
4
+ }
5
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@linagora/twake-mui",
3
3
  "type": "module",
4
- "version": "9.16.0",
4
+ "version": "9.17.0",
5
5
  "description": "MUI v9 theme system for Twake applications",
6
6
  "author": "Twake",
7
7
  "license": "MIT",