emoji-picker-react 4.22.3 → 5.0.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.
Files changed (405) hide show
  1. package/README.md +331 -49
  2. package/dist/DomUtils/categoryNameFromDom.d.ts +1 -1
  3. package/dist/DomUtils/classNames.d.ts +24 -23
  4. package/dist/DomUtils/detectEmojyPartiallyBelowFold.d.ts +2 -2
  5. package/dist/DomUtils/elementPositionInRow.d.ts +5 -5
  6. package/dist/DomUtils/eventBelongsToPicker.d.ts +2 -0
  7. package/dist/DomUtils/focusElement.d.ts +5 -5
  8. package/dist/DomUtils/getActiveElement.d.ts +2 -2
  9. package/dist/DomUtils/isJsdom.d.ts +1 -0
  10. package/dist/DomUtils/isRtl.d.ts +1 -0
  11. package/dist/DomUtils/keyboardNavigation.d.ts +7 -8
  12. package/dist/DomUtils/scrollTo.d.ts +4 -5
  13. package/dist/DomUtils/selectors.d.ts +31 -35
  14. package/dist/EmojiPickerReact.d.ts +5 -5
  15. package/dist/Stylesheet/DedupedStyle.d.ts +13 -0
  16. package/dist/Stylesheet/stylesheet.d.ts +40 -37
  17. package/dist/components/ErrorBoundary.d.ts +15 -15
  18. package/dist/components/Layout/Absolute.d.ts +8 -8
  19. package/dist/components/Layout/Flex.d.ts +13 -13
  20. package/dist/components/Layout/Relative.d.ts +8 -8
  21. package/dist/components/Layout/Space.d.ts +7 -7
  22. package/dist/components/Reactions/BtnPlus.d.ts +2 -2
  23. package/dist/components/Reactions/DEFAULT_REACTIONS.d.ts +1 -1
  24. package/dist/components/Reactions/Reactions.d.ts +3 -2
  25. package/dist/components/atoms/Button.d.ts +11 -6
  26. package/dist/components/body/EmojiCategory.d.ts +13 -12
  27. package/dist/components/body/EmojiList.d.ts +7 -4
  28. package/dist/components/body/EmojiVariationPicker.d.ts +2 -2
  29. package/dist/components/body/MeasureEmoji.d.ts +2 -2
  30. package/dist/components/body/listComponents.d.ts +47 -0
  31. package/dist/components/context/ElementRefContext.d.ts +18 -16
  32. package/dist/components/context/PickerConfigContext.d.ts +14 -9
  33. package/dist/components/context/PickerContext.d.ts +57 -25
  34. package/dist/components/context/PickerDataContext.d.ts +23 -17
  35. package/dist/components/emoji/BaseEmojiProps.d.ts +14 -13
  36. package/dist/components/emoji/ClickableEmojiButton.d.ts +23 -15
  37. package/dist/components/emoji/Emoji.d.ts +18 -15
  38. package/dist/components/emoji/EmojiImg.d.ts +11 -11
  39. package/dist/components/emoji/ExportedEmoji.d.ts +11 -11
  40. package/dist/components/emoji/NativeEmoji.d.ts +6 -6
  41. package/dist/components/emoji/ViewOnlyEmoji.d.ts +3 -3
  42. package/dist/components/emoji/emojiStyles.d.ts +6 -1
  43. package/dist/components/footer/Preview.d.ts +7 -7
  44. package/dist/components/header/Header.d.ts +2 -2
  45. package/dist/components/header/Search/BtnClearSearch.d.ts +2 -2
  46. package/dist/components/header/Search/IcnSearch.d.ts +2 -2
  47. package/dist/components/header/Search/Search.d.ts +11 -3
  48. package/dist/components/header/SkinTonePicker/BtnSkinToneVariation.d.ts +12 -12
  49. package/dist/components/header/SkinTonePicker/SkinTonePicker.d.ts +11 -11
  50. package/dist/components/icons/svgIcons.d.ts +4 -0
  51. package/dist/components/main/PickerMainBehaviors.d.ts +4 -0
  52. package/dist/components/main/defaultAppearance.d.ts +12 -0
  53. package/dist/components/main/labelHeight.d.ts +1 -0
  54. package/dist/components/navigation/CategoryButton.d.ts +12 -12
  55. package/dist/components/navigation/CategoryNavIcon.d.ts +4 -4
  56. package/dist/components/navigation/CategoryNavigation.d.ts +19 -2
  57. package/dist/config/categoryConfig.d.ts +34 -34
  58. package/dist/config/cdnUrls.d.ts +2 -2
  59. package/dist/config/compareConfig.d.ts +10 -2
  60. package/dist/config/config.d.ts +166 -64
  61. package/dist/config/customEmojiConfig.d.ts +14 -14
  62. package/dist/config/defaultPickerConfiguration.d.ts +10 -0
  63. package/dist/config/mutableConfig.d.ts +32 -10
  64. package/dist/config/useConfig.d.ts +48 -36
  65. package/dist/data/defaultEmojiData.d.ts +9 -0
  66. package/dist/data/defaultEmojiData.js +40 -0
  67. package/dist/data/emojis-bn.d.mts +39 -0
  68. package/dist/data/emojis-bn.d.ts +38 -2
  69. package/dist/data/emojis-bn.js +25 -2
  70. package/dist/data/emojis-bn.mjs +2 -0
  71. package/dist/data/emojis-da.d.mts +39 -0
  72. package/dist/data/emojis-da.d.ts +38 -2
  73. package/dist/data/emojis-da.js +25 -2
  74. package/dist/data/emojis-da.mjs +2 -0
  75. package/dist/data/emojis-de.d.mts +39 -0
  76. package/dist/data/emojis-de.d.ts +38 -2
  77. package/dist/data/emojis-de.js +25 -2
  78. package/dist/data/emojis-de.mjs +2 -0
  79. package/dist/data/emojis-en-gb.d.mts +39 -0
  80. package/dist/data/emojis-en-gb.d.ts +38 -2
  81. package/dist/data/emojis-en-gb.js +25 -2
  82. package/dist/data/emojis-en-gb.mjs +2 -0
  83. package/dist/data/emojis-en.d.mts +39 -0
  84. package/dist/data/emojis-en.d.ts +38 -2
  85. package/dist/data/emojis-en.js +25 -2
  86. package/dist/data/emojis-en.mjs +2 -0
  87. package/dist/data/emojis-es-mx.d.mts +39 -0
  88. package/dist/data/emojis-es-mx.d.ts +38 -2
  89. package/dist/data/emojis-es-mx.js +25 -2
  90. package/dist/data/emojis-es-mx.mjs +2 -0
  91. package/dist/data/emojis-es.d.mts +39 -0
  92. package/dist/data/emojis-es.d.ts +38 -2
  93. package/dist/data/emojis-es.js +25 -2
  94. package/dist/data/emojis-es.mjs +2 -0
  95. package/dist/data/emojis-et.d.mts +39 -0
  96. package/dist/data/emojis-et.d.ts +38 -2
  97. package/dist/data/emojis-et.js +25 -2
  98. package/dist/data/emojis-et.mjs +2 -0
  99. package/dist/data/emojis-fi.d.mts +39 -0
  100. package/dist/data/emojis-fi.d.ts +38 -2
  101. package/dist/data/emojis-fi.js +25 -2
  102. package/dist/data/emojis-fi.mjs +2 -0
  103. package/dist/data/emojis-fr.d.mts +39 -0
  104. package/dist/data/emojis-fr.d.ts +38 -2
  105. package/dist/data/emojis-fr.js +25 -2
  106. package/dist/data/emojis-fr.mjs +2 -0
  107. package/dist/data/emojis-hi.d.mts +39 -0
  108. package/dist/data/emojis-hi.d.ts +38 -2
  109. package/dist/data/emojis-hi.js +25 -2
  110. package/dist/data/emojis-hi.mjs +2 -0
  111. package/dist/data/emojis-hu.d.mts +39 -0
  112. package/dist/data/emojis-hu.d.ts +38 -2
  113. package/dist/data/emojis-hu.js +25 -2
  114. package/dist/data/emojis-hu.mjs +2 -0
  115. package/dist/data/emojis-it.d.mts +39 -0
  116. package/dist/data/emojis-it.d.ts +38 -2
  117. package/dist/data/emojis-it.js +25 -2
  118. package/dist/data/emojis-it.mjs +2 -0
  119. package/dist/data/emojis-ja.d.mts +39 -0
  120. package/dist/data/emojis-ja.d.ts +38 -2
  121. package/dist/data/emojis-ja.js +25 -2
  122. package/dist/data/emojis-ja.mjs +2 -0
  123. package/dist/data/emojis-ko.d.mts +39 -0
  124. package/dist/data/emojis-ko.d.ts +38 -2
  125. package/dist/data/emojis-ko.js +25 -2
  126. package/dist/data/emojis-ko.mjs +2 -0
  127. package/dist/data/emojis-lt.d.mts +39 -0
  128. package/dist/data/emojis-lt.d.ts +38 -2
  129. package/dist/data/emojis-lt.js +25 -2
  130. package/dist/data/emojis-lt.mjs +2 -0
  131. package/dist/data/emojis-ms.d.mts +39 -0
  132. package/dist/data/emojis-ms.d.ts +38 -2
  133. package/dist/data/emojis-ms.js +25 -2
  134. package/dist/data/emojis-ms.mjs +2 -0
  135. package/dist/data/emojis-nb.d.mts +39 -0
  136. package/dist/data/emojis-nb.d.ts +38 -2
  137. package/dist/data/emojis-nb.js +25 -2
  138. package/dist/data/emojis-nb.mjs +2 -0
  139. package/dist/data/emojis-nl.d.mts +39 -0
  140. package/dist/data/emojis-nl.d.ts +38 -2
  141. package/dist/data/emojis-nl.js +25 -2
  142. package/dist/data/emojis-nl.mjs +2 -0
  143. package/dist/data/emojis-pl.d.mts +39 -0
  144. package/dist/data/emojis-pl.d.ts +38 -2
  145. package/dist/data/emojis-pl.js +25 -2
  146. package/dist/data/emojis-pl.mjs +2 -0
  147. package/dist/data/emojis-pt.d.mts +39 -0
  148. package/dist/data/emojis-pt.d.ts +38 -2
  149. package/dist/data/emojis-pt.js +25 -2
  150. package/dist/data/emojis-pt.mjs +2 -0
  151. package/dist/data/emojis-ru.d.mts +39 -0
  152. package/dist/data/emojis-ru.d.ts +38 -2
  153. package/dist/data/emojis-ru.js +25 -2
  154. package/dist/data/emojis-ru.mjs +2 -0
  155. package/dist/data/emojis-sv.d.mts +39 -0
  156. package/dist/data/emojis-sv.d.ts +38 -2
  157. package/dist/data/emojis-sv.js +25 -2
  158. package/dist/data/emojis-sv.mjs +2 -0
  159. package/dist/data/emojis-th.d.mts +39 -0
  160. package/dist/data/emojis-th.d.ts +38 -2
  161. package/dist/data/emojis-th.js +25 -2
  162. package/dist/data/emojis-th.mjs +2 -0
  163. package/dist/data/emojis-uk.d.mts +39 -0
  164. package/dist/data/emojis-uk.d.ts +38 -2
  165. package/dist/data/emojis-uk.js +25 -2
  166. package/dist/data/emojis-uk.mjs +2 -0
  167. package/dist/data/emojis-vi.d.mts +39 -0
  168. package/dist/data/emojis-vi.d.ts +38 -2
  169. package/dist/data/emojis-vi.js +25 -2
  170. package/dist/data/emojis-vi.mjs +2 -0
  171. package/dist/data/emojis-zh-hant.d.mts +39 -0
  172. package/dist/data/emojis-zh-hant.d.ts +38 -2
  173. package/dist/data/emojis-zh-hant.js +25 -2
  174. package/dist/data/emojis-zh-hant.mjs +2 -0
  175. package/dist/data/emojis-zh.d.mts +39 -0
  176. package/dist/data/emojis-zh.d.ts +38 -2
  177. package/dist/data/emojis-zh.js +25 -2
  178. package/dist/data/emojis-zh.mjs +2 -0
  179. package/dist/data/index.js +1 -0
  180. package/dist/data/registerDefaultEmojiData.d.ts +1 -0
  181. package/dist/data/registerDefaultEmojiData.js +3 -0
  182. package/dist/data-core/pickerData.d.ts +12 -0
  183. package/dist/data-core/prepare.d.ts +23 -0
  184. package/dist/data-core/search.d.ts +13 -0
  185. package/dist/data-core/types.d.ts +23 -0
  186. package/dist/data.d.mts +72 -0
  187. package/dist/data.d.ts +72 -0
  188. package/dist/dataUtils/DataTypes.d.ts +23 -19
  189. package/dist/dataUtils/emojiSelectors.d.ts +15 -16
  190. package/dist/dataUtils/emojiUtils.d.ts +1 -12
  191. package/dist/dataUtils/nativeEmojiSequenceSupport.d.ts +10 -0
  192. package/dist/dataUtils/nativeEmojiSupport.d.ts +40 -0
  193. package/dist/dataUtils/parseNativeEmoji.d.ts +1 -1
  194. package/dist/dataUtils/suggested.d.ts +11 -11
  195. package/dist/dataUtils/suggestedEmojis.d.ts +7 -0
  196. package/dist/esm/chunks/chunk-46BUDQLE.mjs +228 -0
  197. package/dist/esm/chunks/chunk-7ZGTUZFB.mjs +16 -0
  198. package/dist/esm/chunks/chunk-FQIJ4HBW.mjs +25 -0
  199. package/dist/esm/chunks/chunk-KQPOIRSC.mjs +9305 -0
  200. package/dist/esm/chunks/chunk-LO4TPPLH.mjs +43 -0
  201. package/dist/esm/chunks/emojis-6L3GRBAP.mjs +9 -0
  202. package/dist/esm/data.mjs +18 -0
  203. package/dist/esm/index.mjs +389 -0
  204. package/dist/esm/primitives/index.mjs +67 -0
  205. package/dist/hooks/preloadEmoji.d.ts +9 -9
  206. package/dist/hooks/useActiveCategoryScrollDetection.d.ts +11 -11
  207. package/dist/hooks/useCategoryHeight.d.ts +6 -5
  208. package/dist/hooks/useCloseAllOpenToggles.d.ts +2 -2
  209. package/dist/hooks/useDataIdentityStabilityWarning.d.ts +13 -0
  210. package/dist/hooks/useDebouncedState.d.ts +1 -1
  211. package/dist/hooks/useDisallowMouseMove.d.ts +4 -4
  212. package/dist/hooks/useDisallowedEmojis.d.ts +2 -3
  213. package/dist/hooks/useEmojiPreviewEvents.d.ts +3 -3
  214. package/dist/hooks/useEmojiVirtualization.d.ts +21 -17
  215. package/dist/hooks/useFilter.d.ts +10 -16
  216. package/dist/hooks/useFocus.d.ts +3 -3
  217. package/dist/hooks/useInitialLoad.d.ts +2 -2
  218. package/dist/hooks/useIsEmojiHidden.d.ts +8 -8
  219. package/dist/hooks/useIsMounted.d.ts +1 -1
  220. package/dist/hooks/useIsSearchMode.d.ts +1 -1
  221. package/dist/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
  222. package/dist/hooks/useKeyboardNavigation.d.ts +3 -1
  223. package/dist/hooks/useMouseDownHandlers.d.ts +8 -4
  224. package/dist/hooks/useOnFocus.d.ts +1 -1
  225. package/dist/hooks/useOnScroll.d.ts +2 -2
  226. package/dist/hooks/useReactionsFocus.d.ts +1 -0
  227. package/dist/hooks/useRegisterRegion.d.ts +24 -0
  228. package/dist/hooks/useResolvedEmojiData.d.ts +37 -0
  229. package/dist/hooks/useScrollCategoryIntoView.d.ts +1 -1
  230. package/dist/hooks/useSearchController.d.ts +17 -0
  231. package/dist/hooks/useSearchResults.d.ts +8 -0
  232. package/dist/hooks/useSetVariationPicker.d.ts +2 -2
  233. package/dist/hooks/useShouldHideCustomEmojis.d.ts +1 -1
  234. package/dist/hooks/useShouldShowSkinTonePicker.d.ts +4 -4
  235. package/dist/index.d.mts +376 -0
  236. package/dist/index.d.ts +376 -9
  237. package/dist/index.js +2 -8
  238. package/dist/primitives/CategoryNav.d.ts +4 -0
  239. package/dist/primitives/Empty.d.ts +6 -0
  240. package/dist/primitives/List.d.ts +4 -0
  241. package/dist/primitives/LoadError.d.ts +8 -0
  242. package/dist/primitives/Loading.d.ts +4 -0
  243. package/dist/primitives/Panel.d.ts +3 -0
  244. package/dist/primitives/Preview.d.ts +3 -0
  245. package/dist/primitives/Reactions.d.ts +2 -0
  246. package/dist/primitives/Root.d.ts +26 -0
  247. package/dist/primitives/Search.d.ts +5 -0
  248. package/dist/primitives/SearchInput.d.ts +3 -0
  249. package/dist/primitives/SkinTone.d.ts +4 -0
  250. package/dist/primitives/Viewport.d.ts +19 -0
  251. package/dist/primitives/appearance.d.ts +3 -0
  252. package/dist/primitives/components.d.ts +27 -0
  253. package/dist/primitives/hooks.d.ts +48 -0
  254. package/dist/primitives/index.d.mts +561 -0
  255. package/dist/primitives/index.d.ts +561 -0
  256. package/dist/primitives/index.js +2 -0
  257. package/dist/primitives/nativeProps.d.ts +15 -0
  258. package/dist/primitives/scope.d.ts +13 -0
  259. package/dist/primitives/structuralStyles.d.ts +16 -0
  260. package/dist/primitives/tokens.d.ts +18 -0
  261. package/dist/primitives/types.d.ts +85 -0
  262. package/dist/state/activeEmojiStore.d.ts +7 -0
  263. package/dist/state/navigationRegistry.d.ts +61 -0
  264. package/dist/state/regionTraversal.d.ts +20 -0
  265. package/dist/typeRefinements/typeRefinements.d.ts +6 -6
  266. package/dist/types/exposedTypes.d.ts +16 -6
  267. package/dist/types/exposedTypes.js +5 -0
  268. package/dist/virtualization/virtualizationHelpers.d.ts +20 -18
  269. package/llms-full.txt +3680 -0
  270. package/llms.txt +66 -480
  271. package/package.json +180 -66
  272. package/src/DomUtils/categoryNameFromDom.ts +1 -1
  273. package/src/DomUtils/classNames.ts +1 -0
  274. package/src/DomUtils/elementPositionInRow.ts +26 -4
  275. package/src/DomUtils/eventBelongsToPicker.ts +17 -0
  276. package/src/DomUtils/getActiveElement.ts +7 -1
  277. package/src/DomUtils/isJsdom.ts +12 -0
  278. package/src/DomUtils/isRtl.ts +5 -0
  279. package/src/DomUtils/keyboardNavigation.ts +105 -149
  280. package/src/DomUtils/scrollTo.ts +18 -16
  281. package/src/DomUtils/selectors.ts +20 -111
  282. package/src/EmojiPickerReact.tsx +155 -48
  283. package/src/Stylesheet/DedupedStyle.tsx +80 -0
  284. package/src/Stylesheet/stylesheet.tsx +128 -59
  285. package/src/components/Layout/Flex.tsx +12 -11
  286. package/src/components/Reactions/BtnPlus.tsx +61 -51
  287. package/src/components/Reactions/Reactions.tsx +113 -55
  288. package/src/components/atoms/Button.tsx +18 -15
  289. package/src/components/body/EmojiCategory.tsx +77 -40
  290. package/src/components/body/EmojiList.tsx +55 -23
  291. package/src/components/body/EmojiVariationPicker.tsx +113 -66
  292. package/src/components/body/MeasureEmoji.tsx +9 -2
  293. package/src/components/body/listComponents.tsx +79 -0
  294. package/src/components/context/ElementRefContext.tsx +46 -35
  295. package/src/components/context/PickerConfigContext.tsx +55 -40
  296. package/src/components/context/PickerContext.tsx +567 -92
  297. package/src/components/context/PickerDataContext.tsx +110 -99
  298. package/src/components/emoji/BaseEmojiProps.ts +5 -4
  299. package/src/components/emoji/ClickableEmojiButton.tsx +148 -63
  300. package/src/components/emoji/Emoji.tsx +24 -2
  301. package/src/components/emoji/EmojiImg.tsx +13 -12
  302. package/src/components/emoji/ExportedEmoji.tsx +5 -4
  303. package/src/components/emoji/NativeEmoji.tsx +19 -16
  304. package/src/components/emoji/ViewOnlyEmoji.tsx +55 -30
  305. package/src/components/emoji/emojiStyles.ts +12 -11
  306. package/src/components/footer/Preview.tsx +86 -91
  307. package/src/components/header/Header.tsx +21 -6
  308. package/src/components/header/Search/BtnClearSearch.tsx +69 -55
  309. package/src/components/header/Search/IcnSearch.tsx +21 -21
  310. package/src/components/header/Search/Search.tsx +77 -137
  311. package/src/components/header/SkinTonePicker/BtnSkinToneVariation.tsx +99 -62
  312. package/src/components/header/SkinTonePicker/SkinTonePicker.tsx +84 -46
  313. package/src/components/icons/svgIcons.ts +17 -0
  314. package/src/components/main/PickerMainBehaviors.tsx +163 -0
  315. package/src/components/main/defaultAppearance.tsx +188 -0
  316. package/src/components/main/labelHeight.ts +5 -0
  317. package/src/components/navigation/CategoryButton.tsx +83 -57
  318. package/src/components/navigation/CategoryNavIcon.tsx +73 -194
  319. package/src/components/navigation/CategoryNavigation.tsx +118 -46
  320. package/src/config/categoryConfig.ts +7 -3
  321. package/src/config/cdnUrls.ts +11 -21
  322. package/src/config/compareConfig.ts +128 -30
  323. package/src/config/config.ts +228 -24
  324. package/src/config/defaultPickerConfiguration.ts +7 -0
  325. package/src/config/mutableConfig.ts +44 -20
  326. package/src/config/useConfig.ts +130 -37
  327. package/src/data/defaultEmojiData.ts +49 -0
  328. package/src/data/registerDefaultEmojiData.ts +8 -0
  329. package/src/data-core/pickerData.ts +173 -0
  330. package/src/data-core/prepare.ts +178 -0
  331. package/src/data-core/search.ts +122 -0
  332. package/src/data-core/types.ts +36 -0
  333. package/src/data.ts +10 -0
  334. package/src/dataUtils/DataTypes.ts +4 -0
  335. package/src/dataUtils/emojiSelectors.ts +58 -63
  336. package/src/dataUtils/emojiUtils.ts +17 -74
  337. package/src/dataUtils/nativeEmojiSequenceSupport.ts +116 -0
  338. package/src/dataUtils/nativeEmojiSupport.ts +160 -0
  339. package/src/dataUtils/suggested.ts +8 -4
  340. package/src/dataUtils/suggestedEmojis.ts +92 -0
  341. package/src/env.d.ts +4 -0
  342. package/src/hooks/preloadEmoji.ts +3 -3
  343. package/src/hooks/useActiveCategoryScrollDetection.ts +10 -1
  344. package/src/hooks/useCategoryHeight.ts +82 -8
  345. package/src/hooks/useDataIdentityStabilityWarning.ts +86 -0
  346. package/src/hooks/useDebouncedState.ts +13 -1
  347. package/src/hooks/useDisallowedEmojis.ts +26 -42
  348. package/src/hooks/useEmojiPreviewEvents.ts +43 -10
  349. package/src/hooks/useEmojiVirtualization.tsx +38 -4
  350. package/src/hooks/useFilter.ts +85 -127
  351. package/src/hooks/useFocus.ts +14 -24
  352. package/src/hooks/useIsEmojiHidden.ts +10 -6
  353. package/src/hooks/useKeyboardNavigation.ts +322 -429
  354. package/src/hooks/useMouseDownHandlers.ts +91 -16
  355. package/src/hooks/useOnFocus.ts +12 -3
  356. package/src/hooks/useOnScroll.ts +18 -2
  357. package/src/hooks/useReactionsFocus.ts +118 -0
  358. package/src/hooks/useRegisterRegion.ts +92 -0
  359. package/src/hooks/useResolvedEmojiData.ts +200 -0
  360. package/src/hooks/useScrollCategoryIntoView.ts +74 -12
  361. package/src/hooks/useSearchController.ts +369 -0
  362. package/src/hooks/useSearchResults.ts +51 -0
  363. package/src/hooks/useSetVariationPicker.ts +4 -1
  364. package/src/index.tsx +67 -5
  365. package/src/primitives/CategoryNav.tsx +40 -0
  366. package/src/primitives/Empty.tsx +68 -0
  367. package/src/primitives/List.tsx +61 -0
  368. package/src/primitives/LoadError.tsx +38 -0
  369. package/src/primitives/Loading.tsx +60 -0
  370. package/src/primitives/Panel.tsx +47 -0
  371. package/src/primitives/Preview.tsx +38 -0
  372. package/src/primitives/Reactions.tsx +2 -0
  373. package/src/primitives/Root.tsx +398 -0
  374. package/src/primitives/Search.tsx +41 -0
  375. package/src/primitives/SearchInput.tsx +110 -0
  376. package/src/primitives/SkinTone.tsx +76 -0
  377. package/src/primitives/Viewport.tsx +204 -0
  378. package/src/primitives/appearance.tsx +7 -0
  379. package/src/primitives/components.tsx +30 -0
  380. package/src/primitives/hooks.ts +165 -0
  381. package/src/primitives/index.ts +94 -0
  382. package/src/primitives/nativeProps.ts +90 -0
  383. package/src/primitives/scope.tsx +109 -0
  384. package/src/primitives/structuralStyles.tsx +133 -0
  385. package/src/primitives/tokens.ts +149 -0
  386. package/src/primitives/types.ts +192 -0
  387. package/src/state/activeEmojiStore.ts +39 -0
  388. package/src/state/navigationRegistry.ts +209 -0
  389. package/src/state/regionTraversal.ts +116 -0
  390. package/src/svg.d.ts +2 -2
  391. package/src/types/exposedTypes.ts +28 -1
  392. package/src/virtualization/virtualizationHelpers.ts +20 -6
  393. package/dist/components/body/Body.d.ts +0 -2
  394. package/dist/components/main/PickerMain.d.ts +0 -7
  395. package/dist/dataUtils/alphaNumericEmojiIndex.d.ts +0 -5
  396. package/dist/emoji-picker-react.cjs.development.js +0 -31413
  397. package/dist/emoji-picker-react.cjs.development.js.map +0 -1
  398. package/dist/emoji-picker-react.cjs.production.min.js +0 -2
  399. package/dist/emoji-picker-react.cjs.production.min.js.map +0 -1
  400. package/dist/emoji-picker-react.esm.js +0 -31411
  401. package/dist/emoji-picker-react.esm.js.map +0 -1
  402. package/dist/hooks/useHideEmojisByUniocode.d.ts +0 -1
  403. package/src/components/body/Body.tsx +0 -43
  404. package/src/components/main/PickerMain.tsx +0 -249
  405. package/src/dataUtils/alphaNumericEmojiIndex.ts +0 -21
@@ -0,0 +1,163 @@
1
+ import * as React from 'react';
2
+
3
+ /* global process: readonly */
4
+
5
+ import { categoryIdFromCategoryConfig } from '../../config/categoryConfig';
6
+ import { useMutableConfig } from '../../config/mutableConfig';
7
+ import {
8
+ useCategoriesConfig,
9
+ useDefaultSearchValueConfig,
10
+ useEmojiVersionConfig,
11
+ useSearchValueConfig,
12
+ } from '../../config/useConfig';
13
+ import { useFilter } from '../../hooks/useFilter';
14
+ import {
15
+ useActiveSkinToneState,
16
+ useEmojiSizeState,
17
+ useNavigationRegistry,
18
+ useReactionsModeState,
19
+ } from '../context/PickerContext';
20
+ import { usePickerDataContext } from '../context/PickerDataContext';
21
+
22
+ // Root-scoped behavior companions shared by the default picker and the
23
+ // public Root primitive (single implementation).
24
+
25
+ // Accepted-search synchronization.
26
+ //
27
+ // Controlled mode: filtering is scheduled only when a new accepted
28
+ // `searchValue` prop is observed — a rejected `onSearchChange` proposal
29
+ // schedules nothing. A newer accepted query cancels the pending one via
30
+ // the shared debounced transition. Parent-driven changes never re-emit.
31
+ // Uncontrolled mode: the initial `defaultSearchValue` commits once on
32
+ // mount (filtering applies, but no callback fires for a non-user edit);
33
+ // later edits schedule through the input transition itself.
34
+ export function SearchSync() {
35
+ const searchValue = useSearchValueConfig();
36
+ const defaultSearchValue = useDefaultSearchValueConfig();
37
+ const { onChange: commitFilter } = useFilter();
38
+
39
+ const mode = searchValue !== undefined ? 'controlled' : 'uncontrolled';
40
+ useSearchModeSwitchWarning(mode);
41
+
42
+ // Initial commit only. The stamp (not a first-run flag) makes this
43
+ // StrictMode-safe: the double-invoked mount effect commits once, since
44
+ // the second run observes the stamp. A genuine remount creates a new
45
+ // ref and commits its own initial value again, as it should.
46
+ // commitFilter closes over stable refs/setters only, so the captured
47
+ // first-render instance stays valid for this mount-only effect.
48
+ const initialStamp = React.useRef<string | null | undefined>(undefined);
49
+ React.useEffect(() => {
50
+ if (initialStamp.current !== undefined) {
51
+ return;
52
+ }
53
+ const initial = mode === 'controlled' ? searchValue : defaultSearchValue;
54
+ initialStamp.current = initial ?? null;
55
+ if (initial) {
56
+ commitFilter(initial);
57
+ }
58
+ // eslint-disable-next-line react-hooks/exhaustive-deps
59
+ }, []);
60
+
61
+ // Controlled updates only. Previous-value comparison keeps the mount
62
+ // (and the StrictMode double-invoke) silent; uncontrolled commits
63
+ // schedule through the input transition, and the default value is read
64
+ // once, so later prop changes are ignored here.
65
+ const prevAccepted = React.useRef(searchValue);
66
+ React.useEffect(() => {
67
+ if (
68
+ mode === 'controlled' &&
69
+ searchValue !== undefined &&
70
+ searchValue !== prevAccepted.current
71
+ ) {
72
+ prevAccepted.current = searchValue;
73
+ commitFilter(searchValue);
74
+ }
75
+ // eslint-disable-next-line react-hooks/exhaustive-deps
76
+ }, [mode, searchValue]);
77
+
78
+ return null;
79
+ }
80
+
81
+ const useSearchModeSwitchWarning: (mode: string) => void =
82
+ process.env.NODE_ENV === 'production'
83
+ ? () => undefined
84
+ : useDevSearchModeSwitchWarning;
85
+
86
+ function useDevSearchModeSwitchWarning(mode: string): void {
87
+ const prevMode = React.useRef<string | null>(null);
88
+ React.useEffect(() => {
89
+ if (prevMode.current !== null && prevMode.current !== mode) {
90
+ // eslint-disable-next-line no-console
91
+ console.warn(
92
+ '[emoji-picker-react] Switching between controlled and uncontrolled ' +
93
+ 'search during one mounted lifetime is unsupported.',
94
+ );
95
+ }
96
+ prevMode.current = mode;
97
+ }, [mode]);
98
+ }
99
+
100
+ // Reaction-mode observation. Emits only after an
101
+ // actual state change; initial mount never emits. A previous-value ref
102
+ // (not a first-run flag) makes this StrictMode-safe: the double-invoked
103
+ // mount effect observes an unchanged value both times and stays silent.
104
+ export const ReactionsModeObserver = /* @__PURE__ */ React.memo(
105
+ function ReactionsModeObserver() {
106
+ const [reactionsOpen] = useReactionsModeState();
107
+ const { current } = useMutableConfig();
108
+ const prevReactionsOpen = React.useRef(reactionsOpen);
109
+
110
+ React.useEffect(() => {
111
+ if (prevReactionsOpen.current === reactionsOpen) {
112
+ return;
113
+ }
114
+ prevReactionsOpen.current = reactionsOpen;
115
+ current.onReactionsModeChange?.(reactionsOpen);
116
+ }, [reactionsOpen, current]);
117
+
118
+ return null;
119
+ },
120
+ );
121
+
122
+ // Root-scoped navigation generation.
123
+ // Reactions transitions, dataset identity changes (custom emojis included),
124
+ // category order/membership changes, and measured geometry changes each
125
+ // obsolete pending materialize/scroll/focus completions. Column-count
126
+ // changes invalidate from useCategoryHeight, search intent from
127
+ // useApplySearch, unmount from registry disposal. Native glyph support is
128
+ // deliberately absent: its background check can finish at any moment
129
+ // after the first paint, and a category jump that it cancelled would
130
+ // never arrive. Jumps read their target's offset when they scroll.
131
+ export const NavigationInvalidation = /* @__PURE__ */ React.memo(
132
+ function NavigationInvalidation() {
133
+ const registry = useNavigationRegistry();
134
+ const [reactionsMode] = useReactionsModeState();
135
+ const { emojiData } = usePickerDataContext();
136
+ const [emojiSize] = useEmojiSizeState();
137
+ const emojiVersion = useEmojiVersionConfig();
138
+ const [skinTone] = useActiveSkinToneState();
139
+ // Keyed by order/membership, not identity: the merged config is rebuilt
140
+ // for unrelated prop changes, which must not cancel navigation.
141
+ const inventoryKey = JSON.stringify([
142
+ useCategoriesConfig().map(categoryIdFromCategoryConfig),
143
+ emojiVersion,
144
+ skinTone,
145
+ ]);
146
+ const prevSnapshot = React.useRef<unknown[]>([
147
+ reactionsMode,
148
+ emojiData,
149
+ emojiSize,
150
+ inventoryKey,
151
+ ]);
152
+
153
+ React.useEffect(() => {
154
+ const next = [reactionsMode, emojiData, emojiSize, inventoryKey];
155
+ if (next.every((value, index) => value === prevSnapshot.current[index]))
156
+ return;
157
+ prevSnapshot.current = next;
158
+ registry.invalidate();
159
+ }, [registry, reactionsMode, emojiData, emojiSize, inventoryKey]);
160
+
161
+ return null;
162
+ },
163
+ );
@@ -0,0 +1,188 @@
1
+ import * as React from 'react';
2
+ import { cx } from 'shipstyles';
3
+
4
+ import { ClassNames } from '../../DomUtils/classNames';
5
+ import { stylesheet } from '../../Stylesheet/stylesheet';
6
+ import {
7
+ DEFAULT_PICKER_HEIGHT,
8
+ DEFAULT_PICKER_WIDTH,
9
+ } from '../../config/config';
10
+ import { defaultPickerTokens } from '../../primitives/tokens';
11
+ import { Theme, ThemeValue } from '../../types/exposedTypes';
12
+
13
+ // Official default appearance. Private and DOM-less: classes are merged
14
+ // onto the actual Root `aside` via its native `className` prop, so consumer
15
+ // `className`/`style`/`width`/`height` keep v4 root ownership. The component
16
+ // itself renders no DOM wrapper.
17
+ export function DefaultAppearance({ children }: { children: React.ReactNode }) {
18
+ return <>{children}</>;
19
+ }
20
+
21
+ // Official default appearance for the picker root. Private and DOM-less:
22
+ // these classes are merged onto the actual Root `aside` via its native `className` prop, so
23
+ // consumer `className`/`style`/`width`/`height` keep v4 root ownership.
24
+ // Selector names are unchanged from v4, keeping pixel compatibility.
25
+ export function defaultRootClassName(
26
+ theme: ThemeValue | undefined,
27
+ className?: string,
28
+ unstyled?: boolean,
29
+ ): string {
30
+ // `unstyled` drops the branded chrome and color tokens entirely. Layout,
31
+ // geometry and behavior come from Root's structural sheet, so the picker
32
+ // stays fully functional while every color, border and font is the
33
+ // consumer's (style it through className and [data-epr-part] selectors).
34
+ if (unstyled) {
35
+ return cx(className);
36
+ }
37
+ return cx(
38
+ styles.main,
39
+ styles.baseVariables,
40
+ theme === Theme.DARK && styles.darkTheme,
41
+ theme === Theme.AUTO && styles.autoThemeDark,
42
+ className,
43
+ );
44
+ }
45
+
46
+ export function defaultRootStyle({
47
+ width,
48
+ height,
49
+ style,
50
+ columns,
51
+ }: {
52
+ width: string | number | undefined;
53
+ height: string | number | undefined;
54
+ style: React.CSSProperties | undefined;
55
+ columns?: number;
56
+ }): React.CSSProperties {
57
+ return {
58
+ // v4-compatible default dimensions; consumer style and explicit
59
+ // width/height props both override them. With `columns`, the width
60
+ // fits the columns instead.
61
+ ...(columns === undefined && { width: getDimension(DEFAULT_PICKER_WIDTH) }),
62
+ height: getDimension(DEFAULT_PICKER_HEIGHT),
63
+ ...style,
64
+ ...(width !== undefined ? { width: getDimension(width) } : {}),
65
+ ...(height !== undefined ? { height: getDimension(height) } : {}),
66
+ };
67
+ }
68
+
69
+ function getDimension(dimension: string | number): string | number {
70
+ return typeof dimension === 'number' ? `${dimension}px` : dimension;
71
+ }
72
+
73
+ // Dark-theme value definitions referenced by the DarkTheme overrides.
74
+ // Private to the default tree (see the token preset note): the packed
75
+ // package check scans the primitives bundle for their absence.
76
+ const darkThemeBaseVariables: Record<string, string> = {
77
+ '--epr-dark': '#000',
78
+ '--epr-dark-emoji-variation-picker-bg-color': 'var(--epr-dark)',
79
+ '--epr-dark-highlight-color': '#c0c0c0',
80
+ '--epr-dark-text-color': 'var(--epr-highlight-color)',
81
+ '--epr-dark-hover-bg-color': '#363636f6',
82
+ '--epr-dark-hover-bg-color-reduced-opacity': '#36363680',
83
+ '--epr-dark-focus-bg-color': '#474747',
84
+ '--epr-dark-search-input-bg-color': '#333333',
85
+ '--epr-dark-category-label-bg-color': '#222222e6',
86
+ '--epr-dark-picker-border-color': '#151617',
87
+ '--epr-dark-bg-color': '#222222',
88
+ '--epr-dark-reactions-bg-color': '#22222290',
89
+ '--epr-dark-search-input-bg-color-active': 'var(--epr-dark)',
90
+ '--epr-dark-emoji-variation-indicator-color': '#444',
91
+ '--epr-dark-category-icon-active-color': '#6AA9DD',
92
+ '--epr-dark-category-icon-inactive-color': '#C0C0BF',
93
+ '--epr-dark-skin-tone-picker-menu-color': '#22222295',
94
+ '--epr-dark-skin-tone-outer-border-color':
95
+ 'var(--epr-dark-picker-border-color)',
96
+ '--epr-dark-skin-tone-inner-border-color': '#00000000',
97
+ };
98
+
99
+ const DarkTheme = {
100
+ '--epr-emoji-variation-picker-bg-color':
101
+ 'var(--epr-dark-emoji-variation-picker-bg-color)',
102
+ '--epr-hover-bg-color-reduced-opacity':
103
+ 'var(--epr-dark-hover-bg-color-reduced-opacity)',
104
+ '--epr-highlight-color': 'var(--epr-dark-highlight-color)',
105
+ '--epr-text-color': 'var(--epr-dark-text-color)',
106
+ '--epr-hover-bg-color': 'var(--epr-dark-hover-bg-color)',
107
+ '--epr-focus-bg-color': 'var(--epr-dark-focus-bg-color)',
108
+ '--epr-search-input-bg-color': 'var(--epr-dark-search-input-bg-color)',
109
+ '--epr-category-label-bg-color': 'var(--epr-dark-category-label-bg-color)',
110
+ '--epr-picker-border-color': 'var(--epr-dark-picker-border-color)',
111
+ '--epr-bg-color': 'var(--epr-dark-bg-color)',
112
+ '--epr-reactions-bg-color': 'var(--epr-dark-reactions-bg-color)',
113
+ '--epr-search-input-bg-color-active':
114
+ 'var(--epr-dark-search-input-bg-color-active)',
115
+ '--epr-emoji-variation-indicator-color':
116
+ 'var(--epr-dark-emoji-variation-indicator-color)',
117
+ '--epr-category-icon-active-color':
118
+ 'var(--epr-dark-category-icon-active-color)',
119
+ '--epr-category-icon-inactive-color':
120
+ 'var(--epr-dark-category-icon-inactive-color)',
121
+ '--epr-skin-tone-picker-menu-color':
122
+ 'var(--epr-dark-skin-tone-picker-menu-color)',
123
+ '--epr-skin-tone-outer-border-color':
124
+ 'var(--epr-dark-skin-tone-outer-border-color)',
125
+ '--epr-skin-tone-inner-border-color':
126
+ 'var(--epr-dark-skin-tone-inner-border-color)',
127
+ '--epr-dark-text-color': 'var(--epr-highlight-color)',
128
+ '--epr-dark-hover-bg-color': '#363636f6',
129
+ '--epr-dark-hover-bg-color-reduced-opacity': '#36363680',
130
+ '--epr-dark-focus-bg-color': '#474747',
131
+ '--epr-dark-search-input-bg-color': '#333333',
132
+ '--epr-dark-category-label-bg-color': '#222222e6',
133
+ '--epr-dark-picker-border-color': '#151617',
134
+ '--epr-dark-bg-color': '#222222',
135
+ '--epr-dark-reactions-bg-color': '#22222290',
136
+ '--epr-dark-search-input-bg-color-active': 'var(--epr-dark)',
137
+ '--epr-dark-emoji-variation-indicator-color': '#444',
138
+ '--epr-dark-category-icon-active-color': '#6AA9DD',
139
+ '--epr-dark-category-icon-inactive-color': '#C0C0BF',
140
+ '--epr-dark-skin-tone-picker-menu-color': '#22222295',
141
+ '--epr-dark-skin-tone-outer-border-color':
142
+ 'var(--epr-dark-picker-border-color)',
143
+ '--epr-dark-skin-tone-inner-border-color': '#00000000',
144
+ };
145
+
146
+ const styles = /* @__PURE__ */ (() =>
147
+ stylesheet.create({
148
+ main: {
149
+ '.': ['epr-main', ClassNames.emojiPicker],
150
+ position: 'relative',
151
+ display: 'flex',
152
+ flexDirection: 'column',
153
+ borderWidth: '1px',
154
+ borderStyle: 'solid',
155
+ borderRadius: 'var(--epr-picker-border-radius)',
156
+ borderColor: 'var(--epr-picker-border-color)',
157
+ backgroundColor: 'var(--epr-bg-color)',
158
+ overflow: 'hidden',
159
+ transition: 'height 0.3s ease-in-out, background-color 0.1s ease-in-out',
160
+ '*': {
161
+ boxSizing: 'border-box',
162
+ // Overridable without a specificity fight (v4 hard-coded sans-serif).
163
+ fontFamily: 'var(--epr-font-family, sans-serif)',
164
+ },
165
+ },
166
+ baseVariables: {
167
+ // Single-sourced from the public token preset: the default tree and
168
+ // bare-Root consumers share the same documented defaults. The private
169
+ // dark-theme values ride along (referenced only by the DarkTheme
170
+ // overrides below); they stay out of the shared preset so the
171
+ // primitives bundle keeps its separation marker scan clean.
172
+ '--': { ...defaultPickerTokens, ...darkThemeBaseVariables },
173
+ },
174
+ // color-scheme makes native parts (scrollbars, the search field's
175
+ // controls) render dark too; without it they stay light on a dark picker.
176
+ autoThemeDark: {
177
+ '.': ClassNames.autoTheme,
178
+ '@media (prefers-color-scheme: dark)': {
179
+ '--': DarkTheme,
180
+ colorScheme: 'dark',
181
+ },
182
+ },
183
+ darkTheme: {
184
+ '.': ClassNames.darkTheme,
185
+ '--': DarkTheme,
186
+ colorScheme: 'dark',
187
+ },
188
+ }))();
@@ -0,0 +1,5 @@
1
+ // Shared label-height fallback (pixels). Lives in its own side-effect-free
2
+ // module so measurement code in the primitives closure never imports the
3
+ // default-appearance stylesheet (which would drag branded CSS into the
4
+ // primitives bundle).
5
+ export const DEFAULT_LABEL_HEIGHT = 40;
@@ -7,7 +7,12 @@ import {
7
7
  darkMode,
8
8
  stylesheet,
9
9
  } from '../../Stylesheet/stylesheet';
10
- import { categoryNameFromCategoryConfig } from '../../config/categoryConfig';
10
+ import {
11
+ categoryIdFromCategoryConfig,
12
+ categoryNameFromCategoryConfig,
13
+ } from '../../config/categoryConfig';
14
+ import { useDefaultAppearance } from '../../primitives/appearance';
15
+ import { usePickerComponents } from '../../primitives/components';
11
16
  import { CategoryConfig } from '../../types/exposedTypes';
12
17
  import { Button } from '../atoms/Button';
13
18
 
@@ -30,29 +35,47 @@ export function CategoryButton({
30
35
  onClick,
31
36
  customIcon,
32
37
  }: Props) {
38
+ const appearance = useDefaultAppearance();
39
+ const { CategoryButton: Custom } = usePickerComponents();
40
+ const decorated = appearance && !Custom;
33
41
  // Priority: categoryConfig.icon > customIcon prop (from categoryIcons)
34
42
  const icon = categoryConfig.icon ?? customIcon;
35
43
  const hasCustomIcon = icon != null;
36
44
 
37
- return (
38
- <Button
39
- tabIndex={allowNavigation ? 0 : -1}
40
- className={cx(
41
- styles.catBtn,
42
- commonInteractionStyles.categoryBtn,
43
- hasCustomIcon ? styles.customIcon : `epr-icn-${category}`,
44
- {
45
- [ClassNames.active]: isActiveCategory,
46
- },
47
- )}
48
- onClick={onClick}
49
- aria-label={categoryNameFromCategoryConfig(categoryConfig)}
50
- aria-selected={isActiveCategory}
51
- role="tab"
52
- aria-controls="epr-category-nav-id"
53
- >
54
- {hasCustomIcon ? icon : <CategoryNavIcon category={category} />}
55
- </Button>
45
+ const props: React.ButtonHTMLAttributes<HTMLButtonElement> = {
46
+ type: 'button',
47
+ tabIndex: allowNavigation ? 0 : -1,
48
+ className: cx(
49
+ styles.geometry,
50
+ decorated && styles.catBtn,
51
+ decorated && commonInteractionStyles.categoryBtn,
52
+ hasCustomIcon ? styles.customIcon : `epr-icn-${category}`,
53
+ { [ClassNames.active]: isActiveCategory },
54
+ ),
55
+ onClick: (event) => {
56
+ if (!event.defaultPrevented) onClick();
57
+ },
58
+ 'aria-label': categoryNameFromCategoryConfig(categoryConfig),
59
+ 'aria-selected': isActiveCategory,
60
+ role: 'tab',
61
+ children: hasCustomIcon ? icon : <CategoryNavIcon category={category} />,
62
+ };
63
+ const managed = {
64
+ ...props,
65
+ 'data-epr-part': 'category-tab',
66
+ 'data-epr-active': isActiveCategory ? '' : undefined,
67
+ };
68
+ return Custom ? (
69
+ <Custom
70
+ {...managed}
71
+ category={{
72
+ id: categoryIdFromCategoryConfig(categoryConfig),
73
+ name: categoryNameFromCategoryConfig(categoryConfig),
74
+ isActive: isActiveCategory,
75
+ }}
76
+ />
77
+ ) : (
78
+ <Button {...managed} />
56
79
  );
57
80
  }
58
81
 
@@ -72,41 +95,44 @@ const DarkInactivePosition = {
72
95
  },
73
96
  };
74
97
 
75
- const styles = stylesheet.create({
76
- catBtn: {
77
- '.': 'epr-cat-btn',
78
- display: 'inline-block',
79
- transition: 'opacity 0.2s ease-in-out',
80
- position: 'relative',
81
- height: 'var(--epr-category-navigation-button-size)',
82
- width: 'var(--epr-category-navigation-button-size)',
83
- outline: 'none',
84
- // Icon glyphs are inline SVGs painted with currentColor, so the fill
85
- // follows the --epr-category-icon-*-color variables.
86
- // https://github.com/ealush/emoji-picker-react/issues/399
87
- color: 'var(--epr-category-icon-inactive-color, #868686)',
88
- ':focus:before': {
89
- content: '',
90
- position: 'absolute',
91
- top: '-2px',
92
- left: '-2px',
93
- right: '-2px',
94
- bottom: '-2px',
95
- border: '2px solid var(--epr-category-icon-active-color)',
96
- borderRadius: '50%',
98
+ const styles = /* @__PURE__ */ (() =>
99
+ stylesheet.create({
100
+ geometry: {
101
+ display: 'inline-block',
102
+ position: 'relative',
103
+ height: 'var(--epr-category-navigation-button-size)',
104
+ width: 'var(--epr-category-navigation-button-size)',
97
105
  },
98
- },
99
- customIcon: {
100
- '.': 'epr-cat-btn-custom-icon',
101
- display: 'flex',
102
- alignItems: 'center',
103
- justifyContent: 'center',
104
- },
105
- ...darkMode('catBtn', DarkInactiveColor),
106
- '.epr-dark-theme': {
107
- ...DarkInactivePosition,
108
- },
109
- '.epr-auto-theme': {
110
- ...DarkInactivePosition,
111
- },
112
- });
106
+ catBtn: {
107
+ '.': 'epr-cat-btn',
108
+ transition: 'opacity 0.2s ease-in-out',
109
+ outline: 'none',
110
+ // Icon glyphs are inline SVGs painted with currentColor, so the fill
111
+ // follows the --epr-category-icon-*-color variables.
112
+ // https://github.com/ealush/emoji-picker-react/issues/399
113
+ color: 'var(--epr-category-icon-inactive-color, #868686)',
114
+ ':focus:before': {
115
+ content: '',
116
+ position: 'absolute',
117
+ top: '-2px',
118
+ left: '-2px',
119
+ right: '-2px',
120
+ bottom: '-2px',
121
+ border: '2px solid var(--epr-category-icon-active-color)',
122
+ borderRadius: '50%',
123
+ },
124
+ },
125
+ customIcon: {
126
+ '.': 'epr-cat-btn-custom-icon',
127
+ display: 'flex',
128
+ alignItems: 'center',
129
+ justifyContent: 'center',
130
+ },
131
+ ...darkMode('catBtn', DarkInactiveColor),
132
+ '.epr-dark-theme': {
133
+ ...DarkInactivePosition,
134
+ },
135
+ '.epr-auto-theme': {
136
+ ...DarkInactivePosition,
137
+ },
138
+ }))();