emoji-picker-react 4.0.5 → 4.0.7

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.
@@ -7,6 +7,33 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
7
7
  var React = require('react');
8
8
  var clsx = _interopDefault(require('clsx'));
9
9
 
10
+ var ClassNames;
11
+
12
+ (function (ClassNames) {
13
+ ClassNames["hiddenOnSearch"] = "epr-hidden-on-search";
14
+ ClassNames["searchActive"] = "epr-search-active";
15
+ ClassNames["hidden"] = "epr-hidden";
16
+ ClassNames["visible"] = "epr-visible";
17
+ ClassNames["active"] = "epr-active";
18
+ ClassNames["emoji"] = "epr-emoji";
19
+ ClassNames["category"] = "epr-emoji-category";
20
+ ClassNames["label"] = "epr-emoji-category-label";
21
+ ClassNames["categoryContent"] = "epr-emoji-category-content";
22
+ ClassNames["emojiHasVariatios"] = "epr-emoji-has-variations";
23
+ ClassNames["scrollBody"] = "epr-body";
24
+ ClassNames["external"] = "__EmojiPicker__";
25
+ })(ClassNames || (ClassNames = {}));
26
+
27
+ function asSelectors() {
28
+ for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {
29
+ classNames[_key] = arguments[_key];
30
+ }
31
+
32
+ return classNames.map(function (c) {
33
+ return "." + c;
34
+ }).join('');
35
+ }
36
+
10
37
  function ElementRefContextProvider(_ref) {
11
38
  var children = _ref.children;
12
39
  var PickerMainRef = React.useRef(null);
@@ -163,12 +190,10 @@ function _createForOfIteratorHelperLoose(o, allowArrayLike) {
163
190
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
164
191
  }
165
192
 
166
- var SuggestionMode;
167
-
168
193
  (function (SuggestionMode) {
169
194
  SuggestionMode["RECENT"] = "recent";
170
195
  SuggestionMode["FREQUENT"] = "frequent";
171
- })(SuggestionMode || (SuggestionMode = {}));
196
+ })(exports.SuggestionMode || (exports.SuggestionMode = {}));
172
197
 
173
198
  (function (EmojiStyle) {
174
199
  EmojiStyle["NATIVE"] = "native";
@@ -263,7 +288,7 @@ function mergeCategoriesConfig(userCategoriesConfig, modifiers) {
263
288
 
264
289
  var extra = {};
265
290
 
266
- if (modifiers.suggestionMode === SuggestionMode.RECENT) {
291
+ if (modifiers.suggestionMode === exports.SuggestionMode.RECENT) {
267
292
  extra[exports.Categories.SUGGESTED] = SuggestedRecent;
268
293
  }
269
294
 
@@ -314,19 +339,19 @@ function basePickerConfig() {
314
339
  categories: baseCategoriesConfig(),
315
340
  defaultSkinTone: exports.SkinTones.NEUTRAL,
316
341
  emojiStyle: exports.EmojiStyle.APPLE,
342
+ height: 450,
317
343
  lazyLoadEmojis: false,
318
344
  onEmojiClick: function defaultOnClickHandler( // @ts-ignore
319
345
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
320
346
  emoji, // @ts-ignore
321
347
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
322
348
  event) {},
323
- height: 450,
324
- width: 350,
325
349
  previewConfig: _extends({}, basePreviewConfig),
326
350
  searchPlaceHolder: 'Search',
327
351
  skinTonesDisabled: false,
328
- suggestedEmojisMode: SuggestionMode.FREQUENT,
329
- theme: exports.Theme.LIGHT
352
+ suggestedEmojisMode: exports.SuggestionMode.FREQUENT,
353
+ theme: exports.Theme.LIGHT,
354
+ width: 350
330
355
  };
331
356
  }
332
357
  var basePreviewConfig = {
@@ -15236,32 +15261,6 @@ function useOnMouseMove() {
15236
15261
  }, [BodyRef, allowMouseMove, isMouseDisallowed]);
15237
15262
  }
15238
15263
 
15239
- var ClassNames;
15240
-
15241
- (function (ClassNames) {
15242
- ClassNames["hiddenOnSearch"] = "epr-hidden-on-search";
15243
- ClassNames["searchActive"] = "epr-search-active";
15244
- ClassNames["hidden"] = "epr-hidden";
15245
- ClassNames["visible"] = "epr-visible";
15246
- ClassNames["active"] = "epr-active";
15247
- ClassNames["emoji"] = "epr-emoji";
15248
- ClassNames["category"] = "epr-emoji-category";
15249
- ClassNames["label"] = "epr-emoji-category-label";
15250
- ClassNames["categoryContent"] = "epr-emoji-category-content";
15251
- ClassNames["emojiHasVariatios"] = "epr-emoji-has-variations";
15252
- ClassNames["external"] = "__EmojiPicker__";
15253
- })(ClassNames || (ClassNames = {}));
15254
-
15255
- function asSelectors() {
15256
- for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {
15257
- classNames[_key] = arguments[_key];
15258
- }
15259
-
15260
- return classNames.map(function (c) {
15261
- return "." + c;
15262
- }).join('');
15263
- }
15264
-
15265
15264
  function elementCountInRow(parent, element) {
15266
15265
  if (!parent || !element) {
15267
15266
  return 0;
@@ -15391,19 +15390,54 @@ function elementHeight(element) {
15391
15390
  return (_element$clientHeight = element == null ? void 0 : element.clientHeight) != null ? _element$clientHeight : 0;
15392
15391
  }
15393
15392
  function emojiTrueOffsetTop(element) {
15394
- var _category$clientHeigh, _categoryWithoutLabel;
15395
-
15396
15393
  if (!element) {
15397
15394
  return 0;
15398
15395
  }
15399
15396
 
15400
15397
  var button = buttonFromTarget(element);
15401
- var categoryWithoutLabel = closestCategoryContent(button);
15402
- var category = closestCategory(categoryWithoutLabel); // compensate for the label height
15398
+ var category = closestCategory(button); // compensate for the label height
15403
15399
 
15404
- var labelHeight = ((_category$clientHeigh = category == null ? void 0 : category.clientHeight) != null ? _category$clientHeigh : 0) - ((_categoryWithoutLabel = categoryWithoutLabel == null ? void 0 : categoryWithoutLabel.clientHeight) != null ? _categoryWithoutLabel : 0);
15400
+ var labelHeight = categoryLabelHeight(category);
15405
15401
  return elementOffsetTop(button) + elementOffsetTop(category) + labelHeight;
15406
15402
  }
15403
+ function categoryLabelHeight(category) {
15404
+ var _category$clientHeigh, _categoryWithoutLabel;
15405
+
15406
+ if (!category) {
15407
+ return 0;
15408
+ }
15409
+
15410
+ var categoryWithoutLabel = category.querySelector(asSelectors(ClassNames.categoryContent));
15411
+ return ((_category$clientHeigh = category == null ? void 0 : category.clientHeight) != null ? _category$clientHeigh : 0) - ((_categoryWithoutLabel = categoryWithoutLabel == null ? void 0 : categoryWithoutLabel.clientHeight) != null ? _categoryWithoutLabel : 0);
15412
+ }
15413
+ function isEmojiBehindLabel(emoji) {
15414
+ if (!emoji) {
15415
+ return false;
15416
+ }
15417
+
15418
+ return emojiDistanceFromScrollTop(emoji) < categoryLabelHeight(closestCategory(emoji));
15419
+ }
15420
+ function queryScrollBody(root) {
15421
+ return root ? root.matches(asSelectors(ClassNames.scrollBody)) ? root : root.querySelector(ClassNames.scrollBody) : null;
15422
+ }
15423
+ function emojiDistanceFromScrollTop(emoji) {
15424
+ var _closestScrollBody$sc, _closestScrollBody;
15425
+
15426
+ if (!emoji) {
15427
+ return 0;
15428
+ }
15429
+
15430
+ return emojiTrueOffsetTop(emoji) - ((_closestScrollBody$sc = (_closestScrollBody = closestScrollBody(emoji)) == null ? void 0 : _closestScrollBody.scrollTop) != null ? _closestScrollBody$sc : 0);
15431
+ }
15432
+ function closestScrollBody(element) {
15433
+ var _element$closest;
15434
+
15435
+ if (!element) {
15436
+ return null;
15437
+ }
15438
+
15439
+ return (_element$closest = element.closest(asSelectors(ClassNames.scrollBody))) != null ? _element$closest : null;
15440
+ }
15407
15441
  function emojiTruOffsetLeft(element) {
15408
15442
  var button = buttonFromTarget(element);
15409
15443
  var category = closestCategory(button);
@@ -15575,18 +15609,16 @@ function parseNativeEmoji(unified) {
15575
15609
 
15576
15610
  var SUGGESTED_LS_KEY = 'epr_suggested';
15577
15611
  function getsuggested(mode) {
15578
- var _window;
15579
-
15580
- if (!((_window = window) != null && _window.localStorage)) {
15581
- return [];
15582
- }
15583
-
15584
15612
  try {
15585
- var _window$localStorage$, _window2;
15613
+ var _window, _window$localStorage$, _window2;
15614
+
15615
+ if (!((_window = window) != null && _window.localStorage)) {
15616
+ return [];
15617
+ }
15586
15618
 
15587
15619
  var recent = JSON.parse((_window$localStorage$ = (_window2 = window) == null ? void 0 : _window2.localStorage.getItem(SUGGESTED_LS_KEY)) != null ? _window$localStorage$ : '[]');
15588
15620
 
15589
- if (mode === SuggestionMode.FREQUENT) {
15621
+ if (mode === exports.SuggestionMode.FREQUENT) {
15590
15622
  return recent.sort(function (a, b) {
15591
15623
  return b.count - a.count;
15592
15624
  });
@@ -15688,8 +15720,56 @@ function focusFirstElementChild(element) {
15688
15720
  focusElement(first);
15689
15721
  }
15690
15722
 
15723
+ function scrollTo(root, top) {
15724
+ if (top === void 0) {
15725
+ top = 0;
15726
+ }
15727
+
15728
+ var $eprBody = queryScrollBody(root);
15729
+
15730
+ if (!$eprBody) {
15731
+ return;
15732
+ }
15733
+
15734
+ requestAnimationFrame(function () {
15735
+ $eprBody.scrollTop = top + 1;
15736
+ });
15737
+ }
15738
+ function scrollBy(root, by) {
15739
+ var $eprBody = queryScrollBody(root);
15740
+
15741
+ if (!$eprBody) {
15742
+ return;
15743
+ }
15744
+
15745
+ requestAnimationFrame(function () {
15746
+ $eprBody.scrollTop = $eprBody.scrollTop + by;
15747
+ });
15748
+ }
15749
+ function useScrollTo() {
15750
+ var BodyRef = useBodyRef();
15751
+ return React.useCallback(function (top) {
15752
+ requestAnimationFrame(function () {
15753
+ if (BodyRef.current) {
15754
+ BodyRef.current.scrollTop = top;
15755
+ }
15756
+ });
15757
+ }, [BodyRef]);
15758
+ }
15759
+ function scrollEmojiAboveLabel(emoji) {
15760
+ if (!isEmojiBehindLabel(emoji)) {
15761
+ return;
15762
+ }
15763
+
15764
+ var scrollBody = closestScrollBody(emoji);
15765
+ var by = emojiDistanceFromScrollTop(emoji);
15766
+ scrollBy(scrollBody, -(categoryLabelHeight(closestCategory(emoji)) - by));
15767
+ }
15768
+
15691
15769
  function focusFirstVisibleEmoji(parent) {
15692
- focusElement(firstVisibleEmoji(parent));
15770
+ var emoji = firstVisibleEmoji(parent);
15771
+ focusElement(emoji);
15772
+ scrollEmojiAboveLabel(emoji);
15693
15773
  }
15694
15774
  function focusAndClickFirstVisibleEmoji(parent) {
15695
15775
  var firstEmoji = firstVisibleEmoji(parent);
@@ -15711,6 +15791,7 @@ function focusNextVisibleEmoji(element) {
15711
15791
  }
15712
15792
 
15713
15793
  focusElement(next);
15794
+ scrollEmojiAboveLabel(next);
15714
15795
  }
15715
15796
  function focusPrevVisibleEmoji(element) {
15716
15797
  if (!element) {
@@ -15724,6 +15805,7 @@ function focusPrevVisibleEmoji(element) {
15724
15805
  }
15725
15806
 
15726
15807
  focusElement(prev);
15808
+ scrollEmojiAboveLabel(prev);
15727
15809
  }
15728
15810
  function focusVisibleEmojiOneRowUp(element, exitUp) {
15729
15811
  if (!element) {
@@ -15737,6 +15819,7 @@ function focusVisibleEmojiOneRowUp(element, exitUp) {
15737
15819
  }
15738
15820
 
15739
15821
  focusElement(prev);
15822
+ scrollEmojiAboveLabel(prev);
15740
15823
  }
15741
15824
  function focusVisibleEmojiOneRowDown(element) {
15742
15825
  if (!element) {
@@ -15965,30 +16048,31 @@ function useOnScroll(BodyRef) {
15965
16048
  }, [BodyRef, closeAllOpenToggles]);
15966
16049
  }
15967
16050
 
15968
- function scrollTo(root, top) {
15969
- if (top === void 0) {
15970
- top = 0;
15971
- }
15972
-
15973
- var $eprBody = root ? root.querySelector('.epr-body') : null;
15974
-
15975
- if (!root || !$eprBody) {
15976
- return;
15977
- }
16051
+ function useFocusSearchInput() {
16052
+ var SearchInputRef = useSearchInputRef();
16053
+ return React.useCallback(function () {
16054
+ focusElement(SearchInputRef.current);
16055
+ }, [SearchInputRef]);
16056
+ }
16057
+ function useFocusSkinTonePicker() {
16058
+ var SkinTonePickerRef = useSkinTonePickerRef();
16059
+ return React.useCallback(function () {
16060
+ if (!SkinTonePickerRef.current) {
16061
+ return;
16062
+ }
15978
16063
 
15979
- requestAnimationFrame(function () {
15980
- $eprBody.scrollTop = top + 1;
15981
- });
16064
+ focusFirstElementChild(SkinTonePickerRef.current);
16065
+ }, [SkinTonePickerRef]);
15982
16066
  }
15983
- function useScrollTo() {
15984
- var BodyRef = useBodyRef();
15985
- return React.useCallback(function (top) {
15986
- requestAnimationFrame(function () {
15987
- if (BodyRef.current) {
15988
- BodyRef.current.scrollTop = top;
15989
- }
15990
- });
15991
- }, [BodyRef]);
16067
+ function useFocusCategoryNavigation() {
16068
+ var CategoryNavigationRef = useCategoryNavigationRef();
16069
+ return React.useCallback(function () {
16070
+ if (!CategoryNavigationRef.current) {
16071
+ return;
16072
+ }
16073
+
16074
+ focusFirstElementChild(CategoryNavigationRef.current);
16075
+ }, [CategoryNavigationRef]);
15992
16076
  }
15993
16077
 
15994
16078
  function useSetFilterRef() {
@@ -16005,12 +16089,14 @@ function useSetFilterRef() {
16005
16089
  function useClearSearch() {
16006
16090
  var applySearch = useApplySearch();
16007
16091
  var SearchInputRef = useSearchInputRef();
16092
+ var focusSearchInput = useFocusSearchInput();
16008
16093
  return function clearSearch() {
16009
16094
  if (SearchInputRef.current) {
16010
16095
  SearchInputRef.current.value = '';
16011
16096
  }
16012
16097
 
16013
16098
  applySearch('');
16099
+ focusSearchInput();
16014
16100
  };
16015
16101
  }
16016
16102
  function useAppendSearch() {
@@ -16018,10 +16104,10 @@ function useAppendSearch() {
16018
16104
  var applySearch = useApplySearch();
16019
16105
  return function appendSearch(str) {
16020
16106
  if (SearchInputRef.current) {
16021
- SearchInputRef.current.value = SearchInputRef.current.value + str;
16022
- applySearch(SearchInputRef.current.value);
16107
+ SearchInputRef.current.value = "" + SearchInputRef.current.value + str;
16108
+ applySearch(getNormalizedSearchTerm(SearchInputRef.current.value));
16023
16109
  } else {
16024
- applySearch(str);
16110
+ applySearch(getNormalizedSearchTerm(str));
16025
16111
  }
16026
16112
  };
16027
16113
  }
@@ -16040,8 +16126,9 @@ function useFilter() {
16040
16126
  SearchInputRef: SearchInputRef
16041
16127
  };
16042
16128
 
16043
- function onChange(nextValue) {
16129
+ function onChange(inputValue) {
16044
16130
  var filter = filterRef.current;
16131
+ var nextValue = inputValue.toLowerCase();
16045
16132
 
16046
16133
  if (filter != null && filter[nextValue] || nextValue.length <= 1) {
16047
16134
  return applySearch(nextValue);
@@ -16071,7 +16158,7 @@ function useApplySearch() {
16071
16158
  var PickerMainRef = usePickerMainRef();
16072
16159
  return function applySearch(searchTerm) {
16073
16160
  requestAnimationFrame(function () {
16074
- setSearchTerm(searchTerm.toLowerCase()).then(function () {
16161
+ setSearchTerm(searchTerm ? searchTerm == null ? void 0 : searchTerm.toLowerCase() : searchTerm).then(function () {
16075
16162
  scrollTo(PickerMainRef.current, 0);
16076
16163
  });
16077
16164
  });
@@ -16106,7 +16193,7 @@ function useIsEmojiFiltered() {
16106
16193
  searchTerm = _useSearchTermState3[0];
16107
16194
 
16108
16195
  return function (unified) {
16109
- return isEmojiFilteredBySearchTerm(unified, filter, searchTerm.toLowerCase());
16196
+ return isEmojiFilteredBySearchTerm(unified, filter, searchTerm);
16110
16197
  };
16111
16198
  }
16112
16199
 
@@ -16142,6 +16229,14 @@ function findLongestMatch(keyword, dict) {
16142
16229
  return null;
16143
16230
  }
16144
16231
 
16232
+ function getNormalizedSearchTerm(str) {
16233
+ if (!str || typeof str !== 'string') {
16234
+ return '';
16235
+ }
16236
+
16237
+ return str.trim().toLowerCase();
16238
+ }
16239
+
16145
16240
  function useIsEmojiHidden() {
16146
16241
  var _useEmojisThatFailedT = useEmojisThatFailedToLoadState(),
16147
16242
  emojisThatFailedToLoad = _useEmojisThatFailedT[0];
@@ -16163,6 +16258,14 @@ function asEmoji(emoji) {
16163
16258
  return emoji;
16164
16259
  }
16165
16260
 
16261
+ function Button(props) {
16262
+ return React.createElement("button", Object.assign({
16263
+ type: "button"
16264
+ }, props, {
16265
+ className: clsx('epr-btn', props.className)
16266
+ }), props.children);
16267
+ }
16268
+
16166
16269
  function ClickableEmoji(_ref) {
16167
16270
  var _clsx;
16168
16271
 
@@ -16176,12 +16279,11 @@ function ClickableEmoji(_ref) {
16176
16279
  size = _ref.size,
16177
16280
  lazyLoad = _ref.lazyLoad;
16178
16281
  var hasVariations = emojiHasVariations(emoji);
16179
- return React.createElement("button", {
16282
+ return React.createElement(Button, {
16180
16283
  className: clsx(ClassNames.emoji, (_clsx = {}, _clsx[ClassNames.hidden] = hidden, _clsx[ClassNames.hiddenOnSearch] = hiddenOnSearch, _clsx[ClassNames.visible] = !hidden && !hiddenOnSearch, _clsx[ClassNames.emojiHasVariatios] = hasVariations && showVariations, _clsx)),
16181
16284
  "data-unified": unified,
16182
16285
  "aria-label": emojiName(emoji),
16183
- "data-full-name": emojiNames(emoji),
16184
- type: "button"
16286
+ "data-full-name": emojiNames(emoji)
16185
16287
  }, React.createElement(ViewOnlyEmoji, {
16186
16288
  unified: unified,
16187
16289
  emoji: emoji,
@@ -16507,7 +16609,7 @@ function Body() {
16507
16609
  useMouseDownHandlers(BodyRef);
16508
16610
  useOnMouseMove();
16509
16611
  return React.createElement("div", {
16510
- className: "epr-body",
16612
+ className: ClassNames.scrollBody,
16511
16613
  ref: BodyRef
16512
16614
  }, React.createElement(EmojiVariationPicker, null), React.createElement(EmojiList, null));
16513
16615
  }
@@ -16718,6 +16820,13 @@ function useActiveCategoryScrollDetection(setActiveCategory) {
16718
16820
  }, [BodyRef, setActiveCategory]);
16719
16821
  }
16720
16822
 
16823
+ function useIsSearchMode() {
16824
+ var _useSearchTermState = useSearchTermState(),
16825
+ searchTerm = _useSearchTermState[0];
16826
+
16827
+ return !!searchTerm;
16828
+ }
16829
+
16721
16830
  function useScrollCategoryIntoView() {
16722
16831
  var BodyRef = useBodyRef();
16723
16832
  var PickerMainRef = usePickerMainRef();
@@ -16746,6 +16855,7 @@ function CategoryNavigation() {
16746
16855
 
16747
16856
  var scrollCategoryIntoView = useScrollCategoryIntoView();
16748
16857
  useActiveCategoryScrollDetection(setActiveCategory);
16858
+ var isSearchMode = useIsSearchMode();
16749
16859
  var categoriesConfig = useCategoriesConfig();
16750
16860
  var CategoryNavigationRef = useCategoryNavigationRef();
16751
16861
  return React.createElement("div", {
@@ -16755,8 +16865,8 @@ function CategoryNavigation() {
16755
16865
  var _clsx;
16756
16866
 
16757
16867
  var category = categoryFromCategoryConfig(categoryConfig);
16758
- return React.createElement("button", {
16759
- type: "button",
16868
+ return React.createElement(Button, {
16869
+ tabIndex: isSearchMode ? -1 : 0,
16760
16870
  className: clsx('epr-cat-btn', "epr-icn-" + category, (_clsx = {}, _clsx[ClassNames.active] = category === activeCategory, _clsx)),
16761
16871
  key: category,
16762
16872
  onClick: function onClick() {
@@ -16807,43 +16917,17 @@ function Search() {
16807
16917
  ref: SearchInputRef
16808
16918
  }), React.createElement("div", {
16809
16919
  className: "epr-icn-search"
16810
- }), React.createElement("button", {
16920
+ }), React.createElement(Button, {
16811
16921
  className: clsx('epr-btn-clear-search', 'epr-visible-on-search-only'),
16812
- onClick: clearSearch,
16813
- type: "button"
16814
- }));
16922
+ onClick: clearSearch
16923
+ }, React.createElement("div", {
16924
+ className: "epr-icn-clear-search"
16925
+ })));
16815
16926
  }
16816
16927
 
16817
16928
  function CssSearch(_ref) {
16818
16929
  var value = _ref.value;
16819
- return value ? React.createElement("style", null, "\n .EmojiPickerReact button.epr-emoji:not([data-full-name*=\"" + value.toLowerCase() + "\"]) {\n display: none;\n }\n ") : null;
16820
- }
16821
-
16822
- function useFocusSearchInput() {
16823
- var SearchInputRef = useSearchInputRef();
16824
- return React.useCallback(function () {
16825
- focusElement(SearchInputRef.current);
16826
- }, [SearchInputRef]);
16827
- }
16828
- function useFocusSkinTonePicker() {
16829
- var SkinTonePickerRef = useSkinTonePickerRef();
16830
- return React.useCallback(function () {
16831
- if (!SkinTonePickerRef.current) {
16832
- return;
16833
- }
16834
-
16835
- focusFirstElementChild(SkinTonePickerRef.current);
16836
- }, [SkinTonePickerRef]);
16837
- }
16838
- function useFocusCategoryNavigation() {
16839
- var CategoryNavigationRef = useCategoryNavigationRef();
16840
- return React.useCallback(function () {
16841
- if (!CategoryNavigationRef.current) {
16842
- return;
16843
- }
16844
-
16845
- focusFirstElementChild(CategoryNavigationRef.current);
16846
- }, [CategoryNavigationRef]);
16930
+ return value ? React.createElement("style", null, "\n .EmojiPickerReact button.epr-emoji:not([data-full-name*=\"" + getNormalizedSearchTerm(value) + "\"]) {\n display: none;\n }\n ") : null;
16847
16931
  }
16848
16932
 
16849
16933
  function SkinTonePicker() {
@@ -16876,8 +16960,7 @@ function SkinTonePicker() {
16876
16960
  var _clsx;
16877
16961
 
16878
16962
  var active = skinToneVariation === activeSkinTone;
16879
- return React.createElement("button", {
16880
- type: "button",
16963
+ return React.createElement(Button, {
16881
16964
  style: {
16882
16965
  transform: clsx("translateX(-" + i * (isOpen ? 28 : 0) + "px)", isOpen && active && 'scale(1.3)')
16883
16966
  },
@@ -16908,13 +16991,6 @@ function Header() {
16908
16991
  }, React.createElement(Search, null), React.createElement(SkinTonePicker, null)), React.createElement(CategoryNavigation, null));
16909
16992
  }
16910
16993
 
16911
- function useIsSearchMode() {
16912
- var _useSearchTermState = useSearchTermState(),
16913
- searchTerm = _useSearchTermState[0];
16914
-
16915
- return !!searchTerm;
16916
- }
16917
-
16918
16994
  function getActiveElement() {
16919
16995
  return document.activeElement;
16920
16996
  }
@@ -16951,16 +17027,10 @@ function usePickerMainKeyboardEvents() {
16951
17027
  var onKeyDown = React.useMemo(function () {
16952
17028
  return function onKeyDown(event) {
16953
17029
  var key = event.key;
17030
+ disallowMouseMove();
16954
17031
 
16955
17032
  switch (key) {
16956
- case KeyboardEvents.ArrowDown:
16957
- case KeyboardEvents.ArrowUp:
16958
- case KeyboardEvents.ArrowLeft:
16959
- case KeyboardEvents.ArrowRight:
16960
- disallowMouseMove();
16961
- break;
16962
17033
  // eslint-disable-next-line no-fallthrough
16963
-
16964
17034
  case KeyboardEvents.Escape:
16965
17035
  event.preventDefault();
16966
17036