emoji-picker-react 4.6.1-rc.1 → 4.6.1

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.
@@ -21,4 +21,3 @@ export declare enum ClassNames {
21
21
  autoTheme = "epr-auto-theme"
22
22
  }
23
23
  export declare function asSelectors(...classNames: ClassNames[]): string;
24
- export declare function clsx(...args: any[]): string;
@@ -42,35 +42,6 @@ function asSelectors() {
42
42
  return "." + c;
43
43
  }).join('');
44
44
  }
45
- function clsx() {
46
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
47
- args[_key2] = arguments[_key2];
48
- }
49
-
50
- var classes = args.reduce(function (classes, arg) {
51
- if (typeof arg === 'string') {
52
- classes.push(arg);
53
- }
54
-
55
- if (Array.isArray(arg)) {
56
- classes.push(clsx.apply(void 0, arg));
57
- }
58
-
59
- if (typeof arg === 'object') {
60
- Object.entries(arg).forEach(function (_ref) {
61
- var key = _ref[0],
62
- value = _ref[1];
63
-
64
- if (value) {
65
- classes.push(key);
66
- }
67
- });
68
- }
69
-
70
- return classes;
71
- }, []);
72
- return classes.filter(Boolean).join(' ');
73
- }
74
45
 
75
46
  var stylesheet = /*#__PURE__*/flairup.createSheet('epr');
76
47
 
@@ -18258,7 +18229,8 @@ function getStatusSearchResults(filterState, searchTerm) {
18258
18229
  var _Object$entries;
18259
18230
 
18260
18231
  if (!(filterState != null && filterState[searchTerm])) return '';
18261
- var searchResultsCount = ((_Object$entries = Object.entries(filterState == null ? void 0 : filterState[searchTerm])) == null ? void 0 : _Object$entries.length) || 0;
18232
+ var searchResultsCount = ((_Object$entries = Object.entries(filterState == null ? void 0 : filterState[searchTerm])) == null ? void 0 : _Object$entries.length) || 0; // eslint-disable-next-line react-hooks/rules-of-hooks
18233
+
18262
18234
  return useSearchResultsConfig(searchResultsCount);
18263
18235
  }
18264
18236
 
@@ -18283,12 +18255,12 @@ function Button(props) {
18283
18255
  return React.createElement("button", Object.assign({
18284
18256
  type: "button"
18285
18257
  }, props, {
18286
- className: clsx('epr-btn', props.className)
18258
+ className: flairup.cx('epr-btn', props.className)
18287
18259
  }), props.children);
18288
18260
  }
18289
18261
 
18290
18262
  function ClickableEmojiButton(_ref) {
18291
- var _clsx;
18263
+ var _cx;
18292
18264
 
18293
18265
  var emojiNames = _ref.emojiNames,
18294
18266
  unified = _ref.unified,
@@ -18299,7 +18271,7 @@ function ClickableEmojiButton(_ref) {
18299
18271
  hasVariations = _ref.hasVariations,
18300
18272
  children = _ref.children;
18301
18273
  return React.createElement(Button, {
18302
- className: clsx(ClassNames.emoji, (_clsx = {}, _clsx[ClassNames.hidden] = hidden, _clsx[ClassNames.hiddenOnSearch] = hiddenOnSearch, _clsx[ClassNames.visible] = !hidden && !hiddenOnSearch, _clsx[ClassNames.emojiHasVariations] = hasVariations && showVariations, _clsx)),
18274
+ className: flairup.cx(ClassNames.emoji, (_cx = {}, _cx[ClassNames.hidden] = hidden, _cx[ClassNames.hiddenOnSearch] = hiddenOnSearch, _cx[ClassNames.visible] = !hidden && !hiddenOnSearch, _cx[ClassNames.emojiHasVariations] = hasVariations && showVariations, _cx)),
18303
18275
  "data-unified": unified,
18304
18276
  "aria-label": emojiNames[0],
18305
18277
  "data-full-name": emojiNames
@@ -18316,7 +18288,7 @@ function EmojiImg(_ref) {
18316
18288
  return React.createElement("img", {
18317
18289
  src: imgUrl,
18318
18290
  alt: emojiName,
18319
- className: clsx(ClassNames.external, 'epr-emoji-img'),
18291
+ className: flairup.cx(ClassNames.external, 'epr-emoji-img'),
18320
18292
  loading: lazyLoad ? 'lazy' : 'eager',
18321
18293
  onError: onError,
18322
18294
  style: style
@@ -18327,7 +18299,7 @@ function NativeEmoji(_ref) {
18327
18299
  var unified = _ref.unified,
18328
18300
  style = _ref.style;
18329
18301
  return React.createElement("span", {
18330
- className: clsx(ClassNames.external, 'epr-emoji-native'),
18302
+ className: flairup.cx(ClassNames.external, 'epr-emoji-native'),
18331
18303
  "data-unified": unified,
18332
18304
  style: style
18333
18305
  }, parseNativeEmoji(unified));
@@ -18417,7 +18389,7 @@ function ClickableEmoji(_ref) {
18417
18389
  }
18418
18390
 
18419
18391
  function EmojiCategory(_ref) {
18420
- var _clsx;
18392
+ var _cx;
18421
18393
 
18422
18394
  var categoryConfig = _ref.categoryConfig,
18423
18395
  children = _ref.children,
@@ -18426,7 +18398,7 @@ function EmojiCategory(_ref) {
18426
18398
  var category = categoryFromCategoryConfig(categoryConfig);
18427
18399
  var categoryName = categoryNameFromCategoryConfig(categoryConfig);
18428
18400
  return React.createElement("li", {
18429
- className: clsx(ClassNames.category, (_clsx = {}, _clsx[ClassNames.hidden] = hidden, _clsx[ClassNames.hiddenOnSearch] = hiddenOnSearch, _clsx)),
18401
+ className: flairup.cx(ClassNames.category, (_cx = {}, _cx[ClassNames.hidden] = hidden, _cx[ClassNames.hiddenOnSearch] = hiddenOnSearch, _cx)),
18430
18402
  "data-name": category,
18431
18403
  "aria-label": categoryName
18432
18404
  }, React.createElement("h2", {
@@ -18716,7 +18688,7 @@ function EmojiVariationPicker() {
18716
18688
 
18717
18689
  return React.createElement("div", {
18718
18690
  ref: VariationPickerRef,
18719
- className: clsx(ClassNames.variationPicker, {
18691
+ className: flairup.cx(ClassNames.variationPicker, {
18720
18692
  visible: visible,
18721
18693
  'pointing-up': getMenuDirection() === Direction.Down
18722
18694
  }),
@@ -18930,7 +18902,7 @@ function Flex(_ref) {
18930
18902
  direction = _ref$direction === void 0 ? FlexDirection.ROW : _ref$direction;
18931
18903
  return React.createElement("div", {
18932
18904
  style: _extends({}, style),
18933
- className: clsx('Flex', className, direction)
18905
+ className: flairup.cx('Flex', className, direction)
18934
18906
  }, children);
18935
18907
  }
18936
18908
 
@@ -18942,7 +18914,7 @@ function Space(_ref) {
18942
18914
  style: _extends({
18943
18915
  flex: 1
18944
18916
  }, style),
18945
- className: clsx(className)
18917
+ className: flairup.cx(className)
18946
18918
  });
18947
18919
  }
18948
18920
 
@@ -18986,7 +18958,7 @@ function SkinTonePickerMenu() {
18986
18958
  })));
18987
18959
  }
18988
18960
  function SkinTonePicker(_ref) {
18989
- var _clsx;
18961
+ var _cx;
18990
18962
 
18991
18963
  var _ref$direction = _ref.direction,
18992
18964
  direction = _ref$direction === void 0 ? SkinTonePickerDirection.HORIZONTAL : _ref$direction;
@@ -19012,7 +18984,7 @@ function SkinTonePicker(_ref) {
19012
18984
  var expandedSize = isOpen ? fullWidth : ITEM_SIZE + 'px';
19013
18985
  var vertical = direction === SkinTonePickerDirection.VERTICAL;
19014
18986
  return React.createElement(Relative, {
19015
- className: clsx('epr-skin-tones', direction, (_clsx = {}, _clsx[ClassNames.open] = isOpen, _clsx)),
18987
+ className: flairup.cx('epr-skin-tones', direction, (_cx = {}, _cx[ClassNames.open] = isOpen, _cx)),
19016
18988
  style: vertical ? {
19017
18989
  flexBasis: expandedSize,
19018
18990
  height: expandedSize
@@ -19023,12 +18995,12 @@ function SkinTonePicker(_ref) {
19023
18995
  className: "epr-skin-tone-select",
19024
18996
  ref: SkinTonePickerRef
19025
18997
  }, skinToneVariations.map(function (skinToneVariation, i) {
19026
- var _clsx2;
18998
+ var _cx2;
19027
18999
 
19028
19000
  var active = skinToneVariation === activeSkinTone;
19029
19001
  return React.createElement(Button, {
19030
19002
  style: {
19031
- transform: clsx(vertical ? "translateY(-" + i * (isOpen ? ITEM_SIZE : 0) + "px)" : "translateX(-" + i * (isOpen ? ITEM_SIZE : 0) + "px)", isOpen && active && 'scale(1.3)')
19003
+ transform: flairup.cx(vertical ? "translateY(-" + i * (isOpen ? ITEM_SIZE : 0) + "px)" : "translateX(-" + i * (isOpen ? ITEM_SIZE : 0) + "px)", isOpen && active && 'scale(1.3)')
19032
19004
  },
19033
19005
  onClick: function onClick() {
19034
19006
  if (isOpen) {
@@ -19041,7 +19013,7 @@ function SkinTonePicker(_ref) {
19041
19013
  closeAllOpenToggles();
19042
19014
  },
19043
19015
  key: skinToneVariation,
19044
- className: clsx("epr-tone-" + skinToneVariation, 'epr-tone', (_clsx2 = {}, _clsx2[ClassNames.active] = active, _clsx2)),
19016
+ className: flairup.cx("epr-tone-" + skinToneVariation, 'epr-tone', (_cx2 = {}, _cx2[ClassNames.active] = active, _cx2)),
19045
19017
  tabIndex: isOpen ? 0 : -1,
19046
19018
  "aria-pressed": active,
19047
19019
  "aria-label": "Skin tone " + skinTonesNamed[skinToneVariation]
@@ -19215,13 +19187,13 @@ function CategoryNavigation() {
19215
19187
  var CategoryNavigationRef = useCategoryNavigationRef();
19216
19188
  var hideCustomCategory = useShouldHideCustomEmojis();
19217
19189
  return React.createElement("div", {
19218
- className: 'epr-category-nav',
19219
- role: 'tablist',
19220
- "aria-label": 'Category navigation',
19221
- id: 'epr-category-nav-id',
19190
+ className: "epr-category-nav",
19191
+ role: "tablist",
19192
+ "aria-label": "Category navigation",
19193
+ id: "epr-category-nav-id",
19222
19194
  ref: CategoryNavigationRef
19223
19195
  }, categoriesConfig.map(function (categoryConfig) {
19224
- var _clsx;
19196
+ var _cx;
19225
19197
 
19226
19198
  var category = categoryFromCategoryConfig(categoryConfig);
19227
19199
  var isActiveCategory = category === activeCategory;
@@ -19232,7 +19204,7 @@ function CategoryNavigation() {
19232
19204
 
19233
19205
  return React.createElement(Button, {
19234
19206
  tabIndex: isSearchMode || isActiveCategory ? -1 : 0,
19235
- className: clsx('epr-cat-btn', "epr-icn-" + category, (_clsx = {}, _clsx[ClassNames.active] = isActiveCategory, _clsx)),
19207
+ className: flairup.cx('epr-cat-btn', "epr-icn-" + category, (_cx = {}, _cx[ClassNames.active] = isActiveCategory, _cx)),
19236
19208
  key: category,
19237
19209
  onClick: function onClick() {
19238
19210
  setActiveCategory(category);
@@ -19240,8 +19212,8 @@ function CategoryNavigation() {
19240
19212
  },
19241
19213
  "aria-label": categoryNameFromCategoryConfig(categoryConfig),
19242
19214
  "aria-selected": isActiveCategory,
19243
- role: 'tab',
19244
- "aria-controls": 'epr-category-nav-id'
19215
+ role: "tab",
19216
+ "aria-controls": "epr-category-nav-id"
19245
19217
  });
19246
19218
  }));
19247
19219
  }
@@ -19318,14 +19290,14 @@ function Search() {
19318
19290
  ref: SearchInputRef
19319
19291
  }), searchTerm ? React.createElement("div", {
19320
19292
  role: "status",
19321
- className: clsx('epr-status-search-results', 'epr-status-visually-hidden'),
19293
+ className: flairup.cx('epr-status-search-results', 'epr-status-visually-hidden'),
19322
19294
  "aria-live": "polite",
19323
19295
  id: "epr-search-id",
19324
19296
  "aria-atomic": "true"
19325
19297
  }, statusSearchResults) : null, React.createElement("div", {
19326
19298
  className: "epr-icn-search"
19327
19299
  }), React.createElement(Button, {
19328
- className: clsx('epr-btn-clear-search', 'epr-visible-on-search-only'),
19300
+ className: flairup.cx('epr-btn-clear-search', 'epr-visible-on-search-only'),
19329
19301
  onClick: clearSearch,
19330
19302
  "aria-label": "Clear",
19331
19303
  title: "Clear"
@@ -19831,7 +19803,7 @@ function PickerMain(_ref) {
19831
19803
  }
19832
19804
 
19833
19805
  function PickerRootElement(_ref2) {
19834
- var _clsx;
19806
+ var _cx;
19835
19807
 
19836
19808
  var children = _ref2.children;
19837
19809
  var theme = useThemeConfig();
@@ -19842,7 +19814,7 @@ function PickerRootElement(_ref2) {
19842
19814
  useKeyboardNavigation();
19843
19815
  useOnFocus();
19844
19816
  return React.createElement("aside", {
19845
- className: clsx(ClassNames.emojiPicker, 'epr-main', (_clsx = {}, _clsx[ClassNames.searchActive] = searchModeActive, _clsx[ClassNames.darkTheme] = theme === exports.Theme.DARK, _clsx[ClassNames.autoTheme] = theme === exports.Theme.AUTO, _clsx), className),
19817
+ className: flairup.cx(ClassNames.emojiPicker, 'epr-main', (_cx = {}, _cx[ClassNames.searchActive] = searchModeActive, _cx[ClassNames.darkTheme] = theme === exports.Theme.DARK, _cx[ClassNames.autoTheme] = theme === exports.Theme.AUTO, _cx), className),
19846
19818
  ref: PickerMainRef,
19847
19819
  style: style
19848
19820
  }, children);