From 869fa46bd28f8bb3d38406bd43405580eebf879c Mon Sep 17 00:00:00 2001 From: mario ma Date: Wed, 4 Jun 2025 16:09:44 +0800 Subject: [PATCH] feat: SearchBar clear button support i18n Signed-off-by: mario ma --- .changeset/warm-hornets-unite.md | 5 +++++ plugins/search-react/report-alpha.api.md | 1 + plugins/search-react/src/components/SearchBar/SearchBar.tsx | 4 ++-- plugins/search-react/src/translation.ts | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/warm-hornets-unite.md diff --git a/.changeset/warm-hornets-unite.md b/.changeset/warm-hornets-unite.md new file mode 100644 index 0000000000..65a56233cb --- /dev/null +++ b/.changeset/warm-hornets-unite.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-search-react': patch +--- + +SearchBar clear button support i18n diff --git a/plugins/search-react/report-alpha.api.md b/plugins/search-react/report-alpha.api.md index d3763bfcbf..861958a8ea 100644 --- a/plugins/search-react/report-alpha.api.md +++ b/plugins/search-react/report-alpha.api.md @@ -101,6 +101,7 @@ export const searchReactTranslationRef: TranslationRef< { readonly 'searchBar.title': 'Search'; readonly 'searchBar.placeholder': 'Search in {{org}}'; + readonly 'searchBar.clearButtonTitle': 'Clear'; readonly 'searchFilter.allOptionTitle': 'All'; readonly 'searchPagination.limitLabel': 'Results per page:'; readonly 'searchPagination.limitText': 'of {{num}}'; diff --git a/plugins/search-react/src/components/SearchBar/SearchBar.tsx b/plugins/search-react/src/components/SearchBar/SearchBar.tsx index d2a1d08283..41074a22fb 100644 --- a/plugins/search-react/src/components/SearchBar/SearchBar.tsx +++ b/plugins/search-react/src/components/SearchBar/SearchBar.tsx @@ -154,7 +154,7 @@ export const SearchBarBase = forwardRef((props: SearchBarBaseProps, ref) => { const clearButtonEndAdornment = ( ); diff --git a/plugins/search-react/src/translation.ts b/plugins/search-react/src/translation.ts index 6897911949..e4c394d952 100644 --- a/plugins/search-react/src/translation.ts +++ b/plugins/search-react/src/translation.ts @@ -25,6 +25,7 @@ export const searchReactTranslationRef = createTranslationRef({ searchBar: { title: 'Search', placeholder: 'Search in {{org}}', + clearButtonTitle: 'Clear', }, searchFilter: { allOptionTitle: 'All',