emoji-picker-react 4.20.8 → 4.20.9

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.
@@ -1,2 +1,2 @@
1
1
  /// <reference types="react" />
2
- export declare function CategoryNavigation(): JSX.Element;
2
+ export declare function CategoryNavigation(): JSX.Element | null;
@@ -30599,18 +30599,23 @@ function CategoryNavigation() {
30599
30599
  var categoryIcons = useCategoryIconsConfig();
30600
30600
  var CategoryNavigationRef = useCategoryNavigationRef();
30601
30601
  var hideCustomCategory = useShouldHideCustomEmojis();
30602
+ var visibleCategories = categoriesConfig.filter(function (categoryConfig) {
30603
+ return !(isCustomCategory(categoryConfig) && hideCustomCategory);
30604
+ });
30605
+ // A single tab navigates nowhere — hide the bar to reclaim its space.
30606
+ // https://github.com/ealush/emoji-picker-react/issues/396
30607
+ if (visibleCategories.length <= 1) {
30608
+ return null;
30609
+ }
30602
30610
  return React.createElement("div", {
30603
30611
  className: shipstyles.cx(styles$g.nav),
30604
30612
  role: "tablist",
30605
30613
  "aria-label": "Category navigation",
30606
30614
  id: "epr-category-nav-id",
30607
30615
  ref: CategoryNavigationRef
30608
- }, categoriesConfig.map(function (categoryConfig) {
30616
+ }, visibleCategories.map(function (categoryConfig) {
30609
30617
  var category = categoryFromCategoryConfig(categoryConfig);
30610
30618
  var isActiveCategory = category === activeCategory;
30611
- if (isCustomCategory(categoryConfig) && hideCustomCategory) {
30612
- return null;
30613
- }
30614
30619
  var allowNavigation = !isSearchMode && !isActiveCategory;
30615
30620
  return React.createElement(CategoryButton, {
30616
30621
  key: category,